Repository navigation
fix(tools): stop glob "*" matching across directories on Windows - #528
Merged
aandrew-me merged 1 commit intoNov 6, 2026
Merged
Conversation
The glob tool converts both the pattern and the walked path to forward slashes, then matched them with filepath.Match. On Windows, filepath.Match only treats a backslash as a separator, so "*" and "?" also matched "/": "src/*.go" returned src/nested/deep.go too. Use path.Match, which always uses "/", so a path-scoped pattern matches the same files on every platform. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code Review ✅ Approved🟡 Medium risk · Using path.Match for path-scoped globs prevents wildcard matches across directories, but may omit nested files from results on Windows. Switches the glob tool from VerificationRules No rules evaluated Functional validation Not enabledFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
globtool converts the pattern and each walked path to/and then callsfilepath.Match. On Windows,filepath.Matchonly treats\as a separator, so*also matches/:src/*.goreturnssrc/nested/deep.goas well assrc/helper.go.Switching to
path.Matchmakes the path-scoped case behave the same on every OS.TestGlobToolnow also checks thatsrc/*.godoesn't return the nested file; that check fails on Windows without the change and passes with it.