Re: [PATCH v1 27/45] Convert run_add_interactive to use struct pathspec
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Mar 19, 2013, 01:58 UTC
- Message-ID
- <CACsJy8AMcfwx5UurNQs1-uJLw_Xt+PAHFU_Tjizf2zOsYECyvg@mail.gmail.com>
- In-Reply-To
- <20130318182602.GA2164@serenity.lan>
On Tue, Mar 19, 2013 at 1:26 AM, John Keeping <john@keeping.me.uk> wrote:
Show 19 quoted lines
> On Fri, Mar 15, 2013 at 01:06:42PM +0700, Nguyễn Thái Ngọc Duy wrote: >> 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.
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