summaryrefslogtreecommitdiff
path: root/builtin/checkout.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-07-14 08:35:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-07-15 17:56:08 (GMT)
commit18e4f4059936dd35dfe929f502101ca371af856c (patch)
tree057ac4f2f7555eba3c2e55bfe1ecaf65233dd8a1 /builtin/checkout.c
parent5ab06518a71a8bd128a2aea38ddb537870d3ea2b (diff)
downloadgit-18e4f4059936dd35dfe929f502101ca371af856c.zip
git-18e4f4059936dd35dfe929f502101ca371af856c.tar.gz
git-18e4f4059936dd35dfe929f502101ca371af856c.tar.bz2
checkout: convert read_tree_some to take struct pathspec
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 'builtin/checkout.c')
-rw-r--r--builtin/checkout.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 5d31767..c2f3571 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -83,12 +83,9 @@ static int update_some(const unsigned char *sha1, const char *base, int baselen,
return 0;
}
-static int read_tree_some(struct tree *tree, const char **pathspec)
+static int read_tree_some(struct tree *tree, const struct pathspec *pathspec)
{
- struct pathspec ps;
- init_pathspec(&ps, pathspec);
- read_tree_recursive(tree, "", 0, 0, &ps, update_some, NULL);
- free_pathspec(&ps);
+ read_tree_recursive(tree, "", 0, 0, pathspec, update_some, NULL);
/* update the index with the given tree's info
* for all args, expanding wildcards, and exit
@@ -266,7 +263,7 @@ static int checkout_paths(const struct checkout_opts *opts,
return error(_("corrupt index file"));
if (opts->source_tree)
- read_tree_some(opts->source_tree, opts->pathspec.raw);
+ read_tree_some(opts->source_tree, &opts->pathspec);
ps_matched = xcalloc(1, opts->pathspec.nr);