remove diff_tree_{setup,release}_paths
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
827f4d6c21
commit
bd1928df1d
18
tree-diff.c
18
tree-diff.c
@ -229,11 +229,11 @@ static void try_to_follow_renames(struct tree_desc *t1, struct tree_desc *t2, co
|
||||
diff_opts.break_opt = opt->break_opt;
|
||||
diff_opts.rename_score = opt->rename_score;
|
||||
paths[0] = NULL;
|
||||
diff_tree_setup_paths(paths, &diff_opts);
|
||||
init_pathspec(&diff_opts.pathspec, paths);
|
||||
diff_setup_done(&diff_opts);
|
||||
diff_tree(t1, t2, base, &diff_opts);
|
||||
diffcore_std(&diff_opts);
|
||||
diff_tree_release_paths(&diff_opts);
|
||||
free_pathspec(&diff_opts.pathspec);
|
||||
|
||||
/* Go through the new set of filepairing, and see if we find a more interesting one */
|
||||
opt->found_follow = 0;
|
||||
@ -252,9 +252,9 @@ static void try_to_follow_renames(struct tree_desc *t1, struct tree_desc *t2, co
|
||||
choice = p;
|
||||
|
||||
/* Update the path we use from now on.. */
|
||||
diff_tree_release_paths(opt);
|
||||
free_pathspec(&opt->pathspec);
|
||||
opt->pathspec.raw[0] = xstrdup(p->one->path);
|
||||
diff_tree_setup_paths(opt->pathspec.raw, opt);
|
||||
init_pathspec(&opt->pathspec, opt->pathspec.raw);
|
||||
|
||||
/*
|
||||
* The caller expects us to return a set of vanilla
|
||||
@ -328,13 +328,3 @@ int diff_root_tree_sha1(const unsigned char *new, const char *base, struct diff_
|
||||
free(tree);
|
||||
return retval;
|
||||
}
|
||||
|
||||
void diff_tree_release_paths(struct diff_options *opt)
|
||||
{
|
||||
free_pathspec(&opt->pathspec);
|
||||
}
|
||||
|
||||
void diff_tree_setup_paths(const char **p, struct diff_options *opt)
|
||||
{
|
||||
init_pathspec(&opt->pathspec, p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user