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:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-07-15 17:56:08 (GMT)
commit480ca6449ed0981311b8aef2fbaa89d024b881ee (patch)
treed9741f5300117f5c66b9b591f2bd44e4a08617c8 /builtin/checkout.c
parent5ab2a2dabd6e13cd6830ff4f12f232dc79278e29 (diff)
downloadgit-480ca6449ed0981311b8aef2fbaa89d024b881ee.zip
git-480ca6449ed0981311b8aef2fbaa89d024b881ee.tar.gz
git-480ca6449ed0981311b8aef2fbaa89d024b881ee.tar.bz2
convert run_add_interactive to use struct pathspec
This passes the pathspec, more or less unmodified, to git-add--interactive. The command itself does not process pathspec. It simply passes the pathspec to other builtin commands. So if all those commands support pathspec, we're good. 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, 4 insertions, 5 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 2f0fb8d..5d31767 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -257,7 +257,7 @@ static int checkout_paths(const struct checkout_opts *opts,
if (opts->patch_mode)
return run_add_interactive(revision, "--patch=checkout",
- opts->pathspec.raw);
+ &opts->pathspec);
lock_file = xcalloc(1, sizeof(struct lock_file));
@@ -1159,10 +1159,9 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
* cannot handle. Magic mask is pretty safe to be
* lifted for new magic when opts.patch_mode == 0.
*/
- parse_pathspec(&opts.pathspec,
- opts.patch_mode == 0 ? 0 :
- (PATHSPEC_ALL_MAGIC & ~PATHSPEC_FROMTOP),
- 0, prefix, argv);
+ parse_pathspec(&opts.pathspec, 0,
+ opts.patch_mode ? PATHSPEC_PREFIX_ORIGIN : 0,
+ prefix, argv);
if (!opts.pathspec.nr)
die(_("invalid path specification"));