From 480ca6449ed0981311b8aef2fbaa89d024b881ee 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:50 +0700 Subject: convert run_add_interactive to use struct pathspec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- builtin/checkout.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'builtin/checkout.c') diff --git a/builtin/checkout.c b/builtin/checkout.c index 2f0fb8d07c..5d317670ea 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")); -- cgit v1.2.1