Repository navigation
Keep case-sensitive globs off DotNet.Glob's global default [patch] - #189
matt-edmondson wants to merge 2 commits into
Conversation
ResolveGlob passed its own options only on the case-insensitive path. Glob.Parse(pattern) without options reads DotNet.Glob's static, mutable GlobOptions.Default, so a host that set GlobOptions.Default.Evaluation.CaseInsensitive = true quietly turned the default CaseSensitive filters, and explicit CaseSensitive ones, case-insensitive: `*.jpg` matched `IMG.JPG` and `-*.jpg` hid it. Which patterns were affected depended on whether they were cached before the flip. Parse the case-sensitive branch with a private CaseSensitiveGlobOptions, so TextFilter never reads GlobOptions.Default. Fixes #188 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW3SsCYipEZieVhB1tG
…from #186) ReadmeTests fails on main because the EditorBrowsable(Never) binary-compatibility overloads carry no defaults by design. Ported from open PR #186 so this PR's CI shows its own result. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW3SsCYipEZieVhB1tG
|
The cause is that the I've pushed a port of the test-only fix from open PR #186, which checks only the visible overloads. Locally the full suite now passes, 269/269. Whichever of the two PRs merges second should apply cleanly, since the change is identical. Generated by Claude Code |
|
|
The findings:
Why Sonar counts them as new here: its last analysis of Fix: once All test jobs are green on the current head (73ce9a0). Generated by Claude Code |




Fixes #188
What changed
ResolveGlobpassed its ownGlobOptionsonly on the case-insensitive path.Glob.Parse(pattern)with no options reads DotNet.Glob's static, mutableGlobOptions.Default.A host that set
GlobOptions.Default.Evaluation.CaseInsensitive = truetherefore made both the default sensitivity and an explicitCaseSensitivematch without regard to case.*.jpgmatchedIMG.JPG, and-*.jpghid it. Which patterns were affected depended on whetherGlobCachealready held them from before the flip.The case-sensitive branch now parses with a private
CaseSensitiveGlobOptions, so TextFilter never readsGlobOptions.Default. Regex mode was never affected.Tests
GlobDefaultOptionsTestsflipsGlobOptions.Default.Evaluation.CaseInsensitiveto true and restores it infinally. It is marked[DoNotParallelize]and uses patterns no other test parses, so the cache can't mask the bug. It asserts:CaseSensitivesensitivities still treat case as significantCaseInsensitivestill ignores caseWith the library change reverted, the test fails on its first assertion. With the change, 268/269 tests pass.
The remaining failure,
ReadmeTests.EveryMethodInTheReadmeApiReferenceExistsWithItsDocumentedDefaults, fails identically onmainwithout this change. Open PR #186 addresses it.Generated by Claude Code