aboutsummaryrefslogtreecommitdiff
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:58 +0700
committerJunio C Hamano <gitster@pobox.com>2013-07-15 10:56:09 -0700
commitbd1928df1d1cc6a10a7b275694d3504d9a041fae (patch)
treeda8837867af8d30a91cee8e085fd372ee300df67 /tree-diff.c
parent827f4d6c218448d58f934c0980b6366407261b74 (diff)
downloadgit-bd1928df1d1cc6a10a7b275694d3504d9a041fae.tar.gz
git-bd1928df1d1cc6a10a7b275694d3504d9a041fae.tar.xz
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>
Diffstat (limited to 'tree-diff.c')
-rw-r--r--tree-diff.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/tree-diff.c b/tree-diff.c
index 5a876148b..f4c92f6e2 100644
--- a/tree-diff.c
+++ b/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);
-}