Subject: Re: [PATCH] t3706: Add test for wildcard vs literal pathspec

From: Junio C Hamano <[email-masked]>
Date: Wed, 16 Apr 2025 09:00:51 -0700

Lucas Seiki Oshiro <[email-masked]> writes:

> So, if I'm not doing anything wrong, it looks that it is not solely
> related to pathspecs, but related to pathspecs when used with some other
> commands. hmmm...

I haven't looked into the code, but if my recollection is correct,
"add" is a bit curious in that it has to deal with paths that are
not yet in the index, unlike "ls-files" and "grep".  It could be one
half of the code paths use the "grab everything that matches the
glob" while the other half uses "stop when there is an exact match",
perhaps?  In the very early days of Git, I do recall making a very
conscious decision to stop when there is an exact match to help
those who add funny pathsnames with glob characters in it, but that
is a long time ago, so I wouldn't be surprised if we gained multiple
code paths to do the same thing, some of which have been corrected
while the original ones haven't.