summaryrefslogtreecommitdiff
path: root/tree-diff.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-07-14 15:35:59 +0700
committerJunio C Hamano <gitster@pobox.com>2013-07-15 10:56:09 -0700
commit9a0872744315da67db3c81eb9270751e31fcc8f5 (patch)
tree92cd78dc92a8f8f482592e05f678e4a069c0fe33 /tree-diff.c
parentbd1928df1d1cc6a10a7b275694d3504d9a041fae (diff)
downloadgit-9a0872744315da67db3c81eb9270751e31fcc8f5.tar.gz
remove init_pathspec() in favor of parse_pathspec()
While at there, move free_pathspec() to pathspec.c Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree-diff.c')
-rw-r--r--tree-diff.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tree-diff.c b/tree-diff.c
index f4c92f6e20..e1145c60e7 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -195,7 +195,6 @@ static void try_to_follow_renames(struct tree_desc *t1, struct tree_desc *t2, co
struct diff_options diff_opts;
struct diff_queue_struct *q = &diff_queued_diff;
struct diff_filepair *choice;
- const char *paths[1];
int i;
/*
@@ -228,8 +227,6 @@ static void try_to_follow_renames(struct tree_desc *t1, struct tree_desc *t2, co
diff_opts.single_follow = opt->pathspec.raw[0];
diff_opts.break_opt = opt->break_opt;
diff_opts.rename_score = opt->rename_score;
- paths[0] = NULL;
- init_pathspec(&diff_opts.pathspec, paths);
diff_setup_done(&diff_opts);
diff_tree(t1, t2, base, &diff_opts);
diffcore_std(&diff_opts);
@@ -247,14 +244,17 @@ static void try_to_follow_renames(struct tree_desc *t1, struct tree_desc *t2, co
*/
if ((p->status == 'R' || p->status == 'C') &&
!strcmp(p->two->path, opt->pathspec.raw[0])) {
+ const char *path[2];
+
/* Switch the file-pairs around */
q->queue[i] = choice;
choice = p;
/* Update the path we use from now on.. */
+ path[0] = p->one->path;
+ path[1] = NULL;
free_pathspec(&opt->pathspec);
- opt->pathspec.raw[0] = xstrdup(p->one->path);
- init_pathspec(&opt->pathspec, opt->pathspec.raw);
+ parse_pathspec(&opt->pathspec, PATHSPEC_ALL_MAGIC, 0, "", path);
/*
* The caller expects us to return a set of vanilla