Repository navigation
Make glob **/ match zero or more path segments again - #145
Merged
Merged
Conversation
Masking path separators (#114) hid the separators DotNet.Glob uses to recognise "**/", so src/**/*.cs and **/*.cs matched nothing. Each "**/" is now expanded into its zero-segment and "*/" forms before parsing, and a token matches if any expansion does. The #114 behaviour is unchanged. Fixes #126 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01634kz4hrbkEJcGHKJWQjtA
|
This was referenced Oct 7, 2026
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.



Fixes #126
What changed
The #114 fix replaces
/and\with U+E000 before DotNet.Glob sees the pattern, so*and?can cross slashes. A side effect is that DotNet.Glob no longer recognises**/as "zero or more segments", sosrc/**/*.cs,**/*.csand**/readme.mdmatched nothing.ResolveGlobnow expands every masked**/into two forms before it parses:**/removed*/form, meaning anything up to a separatorA token matches if any expansion matches. Up to 4
**/per token get both forms, which is 16 globs at most. Any beyond that keep only the*/form. The glob cache now storesGlob[]instead ofGlob.Tests
GlobStarSlashMatchesZeroOrMoreSegmentscovers every case in the issue, plus backslash separators and a 5×**/pattern. Also new:GlobStarSlashStillRejectsNonMatchingPaths,GlobStarSlashFiltersPathItemsandGlobStarSlashMatchesCaseInsensitively.**/cases fail. With the fix they pass.GlobStarMatchesAcrossSlash,GlobFilterKeepsPathItemsandGlobLiteralSlashInPatternStillMatchesSlashInText.🤖 Generated with Claude Code
https://claude.ai/code/session_01634kz4hrbkEJcGHKJWQjtA
Generated by Claude Code