Re: [PATCH] t3070: skip ls-files tests with backslash patterns on Windows
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 28, 2026, 20:25 UTC
- Message-ID
- <xmqqecivjn7k.fsf@gitster.g>
- In-Reply-To
- <pull.2128.git.1779958849319.gitgitgadget@gmail.com>
"Kristofer Karlsson via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 18 quoted lines
> From: Kristofer Karlsson <krka@spotify.com> > > On Windows (MINGW), backslashes in pathspecs are silently converted to > forward slashes (directory separators), which changes the glob semantics. > This causes 36 test failures in t3070-wildmatch when the "via ls-files" > variants test patterns containing backslash escapes (e.g. '\[ab]', > '[\-_]', '[A-\\]'). > > The wildmatch function itself handles these patterns correctly — only the > ls-files code path fails because pathspec parsing converts the > backslashes before they reach the glob matcher. > > Skip these ls-files tests on platforms where BSLASHPSPEC is not set, > which is the existing prereq that captures exactly this semantic: > "backslashes in pathspec are not directory separators." > > Signed-off-by: Kristofer Karlsson <krka@spotify.com> > ---
Thanks for noticing and addressing this. I think we fairly recently started seeing this in GitHub actions CI, which puzzles me since neither t3070 or wildmatch.[ch] have changed for quite some time. 8a6d158a (doc: document backslash in gitignore patterns, 2025-10-29) added a few lines to the test about matching with backslash to t3070.
Two questions.
* Has this been broken on Windows since October, or has something external change on Windows recently? I do not know. Anybody knows?
* Is this change a workaround that sweeps ugly breakage under the rug, or is backslash inherently unusable as an excape character when handling paths on Windows (which I am afraid would make wildmatch fairly useless there)?
Will queue. Thanks.