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>
diff --git a/tree-diff.c b/tree-diff.c
index 5a87614..f4c92f6 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -229,11 +229,11 @@
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 @@
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 @@
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);
-}