diff options
Diffstat (limited to 'tree-diff.c')
-rw-r--r-- | tree-diff.c | 10 |
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 |