From bd1928df1d1cc6a10a7b275694d3504d9a041fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sun, 14 Jul 2013 15:35:58 +0700 Subject: remove diff_tree_{setup,release}_paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- tree-diff.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'tree-diff.c') diff --git a/tree-diff.c b/tree-diff.c index 5a876148bb..f4c92f6e20 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); -} -- cgit v1.2.3