Thread (66 messages) flat view 66 messages, 4 authors, 2016-06-15

Re: [PATCH v1 27/45] Convert run_add_interactive to use struct pathspec

From: Duy Nguyen <hidden>
Date: 2016-06-15 22:56:26
Subsystem: the rest · Maintainer: Linus Torvalds

On Tue, Mar 19, 2013 at 1:26 AM, John Keeping [off-list ref] wrote:
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.
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help