Prefix is the result of Git moving back from current directory to
worktree's top directory and it has to prepend all user provided paths
so that they become relative to the new current directory. Any
wildcards in the prefix should not be treated as such because it's not
the user intention. Make sure all wildcards in the prefix part is
disabled.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com>
---
 setup.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/setup.c b/setup.c
index 4fcdae6..573ef79 100644
--- a/setup.c
+++ b/setup.c
@@ -250,6 +250,8 @@ static unsigned prefix_pathspec(struct pathspec_item *item,
        *raw = item->match;
        item->len = strlen(item->match);
        item->nowildcard_len = simple_length(item->match);
+       if (item->nowildcard_len < prefixlen)
+               item->nowildcard_len = prefixlen;
        return magic;
 }
 
-- 
1.8.0.rc2.23.g1fb49df

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to