aboutsummaryrefslogtreecommitdiff
path: root/builtin/reset.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-07-14 15:35:50 +0700
committerJunio C Hamano <gitster@pobox.com>2013-07-15 10:56:08 -0700
commit480ca6449ed0981311b8aef2fbaa89d024b881ee (patch)
treed9741f5300117f5c66b9b591f2bd44e4a08617c8 /builtin/reset.c
parent5ab2a2dabd6e13cd6830ff4f12f232dc79278e29 (diff)
downloadgit-480ca6449ed0981311b8aef2fbaa89d024b881ee.tar.gz
git-480ca6449ed0981311b8aef2fbaa89d024b881ee.tar.xz
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/reset.c')
-rw-r--r--builtin/reset.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/reset.c b/builtin/reset.c
index 313b296ef..9bef869fe 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -219,9 +219,9 @@ static void parse_args(struct pathspec *pathspec,
}
}
*rev_ret = rev;
- parse_pathspec(pathspec,
- patch_mode ? PATHSPEC_ALL_MAGIC & ~PATHSPEC_FROMTOP : 0,
- PATHSPEC_PREFER_FULL,
+ parse_pathspec(pathspec, 0,
+ PATHSPEC_PREFER_FULL |
+ (patch_mode ? PATHSPEC_PREFIX_ORIGIN : 0),
prefix, argv);
}
@@ -299,7 +299,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
if (patch_mode) {
if (reset_type != NONE)
die(_("--patch is incompatible with --{hard,mixed,soft}"));
- return run_add_interactive(sha1_to_hex(sha1), "--patch=reset", pathspec.raw);
+ return run_add_interactive(sha1_to_hex(sha1), "--patch=reset", &pathspec);
}
/* git reset tree [--] paths... can be used to