Re: [PATCH v1 27/45] Convert run_add_interactive to use struct pathspec
From: John Keeping <hidden>
Date: 2016-06-15 22:56:26
On Tue, Mar 19, 2013 at 08:58:23AM +0700, Duy Nguyen wrote:
On Tue, Mar 19, 2013 at 1:26 AM, John Keeping [off-list ref] wrote:quoted
On Fri, Mar 15, 2013 at 01:06:42PM +0700, Nguyễn Thái Ngọc Duy wrote:quoted
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.This breaks "git reset --keep" in a subdirectory for me. I ran "git reset --keep <branch>" in a subdirectory and got: fatal: BUG: parse_pathspec cannot take no argument in this case Bisecting points to this commit. The simplest test case is: ( cd t && ../bin-wrappers/git reset --keep HEAD ) which works on master but not pu.Beautiful. I got messed up with C operator precedence. This should fix it. I'll check the rest of parse_pathspec calls later.
Yes, this fixes it. Thanks.
quoted hunk ↗ jump to hunk
diff --git a/builtin/reset.c b/builtin/reset.c index ab3917d..b665218 100644 --- a/builtin/reset.c +++ b/builtin/reset.c@@ -219,7 +219,7 @@ static void parse_args(struct pathspec *pathspec, *rev_ret = rev; parse_pathspec(pathspec, 0, PATHSPEC_PREFER_FULL | - patch_mode ? PATHSPEC_PREFIX_ORIGIN : 0, + (patch_mode ? PATHSPEC_PREFIX_ORIGIN : 0), prefix, argv); }-- Duy