git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/1] add: fix pathspec handling when literal filenames match wildcard

From
K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
Date
Apr 12, 2025, 09:46 UTC
Message-ID
<20250412094607.236382-1-jayatheerthkulkarni2005@gmail.com>

This patch fixes a bug in `git add` where a wildcard pathspec (e.g., 'f*') fails to expand correctly if a file with the *exact* name ('f*') exists. Previously, Git would incorrectly add only the literal match on the first run and skip expanding the wildcard.

With this fix, wildcard expansion behaves consistently even in the presence of an exact filename match.

To explicitly add the literal file, users should quote the wildcard:
    git add 'f\*'
Thanks you
K Jayatheerth (1):
  add: fix handling literal filenames and wildcards
 dir.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
-- 
2.49.0
Next: K Jayatheerth
Message 1 of 19 in “add: fix pathspec handling when literal filenames match wildcard”
  1. 0/1 add: fix pathspec handling when literal filenames match wildcardK Jayatheerth, Apr 12, 2025
  2. 1/1 add: fix handling literal filenames and wildcardsK Jayatheerth, Apr 12, 2025
  3. t3706: Add test for wildcard vs literal pathspecK Jayatheerth, Apr 12, 2025
  4. Lucas Seiki OshiroApr 14, 2025
  5. JAYATHEERTH KApr 14, 2025
  6. Junio C HamanoApr 14, 2025
  7. brian m. carlsonApr 15, 2025
  8. JAYATHEERTH KApr 16, 2025
  9. Junio C HamanoApr 16, 2025
  10. JAYATHEERTH KApr 16, 2025
  11. Lucas Seiki OshiroApr 16, 2025
  12. Junio C HamanoApr 16, 2025
  13. JAYATHEERTH KApr 19, 2025
  14. Lucas Seiki OshiroApr 19, 2025
  15. JAYATHEERTH KApr 22, 2025
  16. JAYATHEERTH KApr 16, 2025
  17. JAYATHEERTH KApr 16, 2025
  18. Lucas Seiki OshiroApr 12, 2025
  19. JAYATHEERTH KApr 12, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.