Merge branch 'kj/glob-path-with-special-char'

"git add 'f?o'" did not add 'foo' if 'f?o', an unusual pathname,
also existed on the working tree, which has been corrected.

* kj/glob-path-with-special-char:
  dir.c: literal match with wildcard in pathspec should still glob
This commit is contained in:
Junio C Hamano
2025-05-13 14:05:07 -07:00
3 changed files with 432 additions and 1 deletions

3
dir.c
View File

@@ -518,7 +518,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