mirror of
https://github.com/git/git.git
synced 2026-06-30 19:58:12 +00:00
dir.c: literal match with wildcard in pathspec should still glob
When a path with wildcard characters, e.g. 'f*o', exists in the working tree, "git add -- 'f*o'" stops after happily finding that there is 'f*o' and adding it to the index, without realizing there may be other paths, e.g. 'foooo', that may match the given pathspec. This is because dir.c:do_match_pathspec() disables further matches with pathspec when it finds an exact match. Reported-by: piotrsiupa <piotrsiupa@gmail.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
d50a5e8939
commit
ec727e189c
3
dir.c
3
dir.c
@@ -519,7 +519,8 @@ static int do_match_pathspec(struct index_state *istate,
|
||||
( exclude && !(ps->items[i].magic & PATHSPEC_EXCLUDE)))
|
||||
continue;
|
||||
|
||||
if (seen && seen[i] == MATCHED_EXACTLY)
|
||||
if (seen && seen[i] == MATCHED_EXACTLY &&
|
||||
ps->items[i].nowildcard_len == ps->items[i].len)
|
||||
continue;
|
||||
/*
|
||||
* Make exclude patterns optional and never report
|
||||
|
||||
Reference in New Issue
Block a user