fs: apply nocase to literal glob exclude patterns - #64817
Open
yhay81 wants to merge 1 commit into
Open
Conversation
On case-insensitive platforms include patterns match entries regardless of case, but literal (non-magic) exclude patterns were matched case-sensitively because exclude matchers are created with nocaseMagicOnly. Exclusion is a pure string match with no filesystem lookups, so disable nocaseMagicOnly for exclude matchers. Fixes: nodejs#58991 Refs: nodejs#63446 Signed-off-by: Yusuke Hayashi <yusuke8h@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #64817 +/- ##
==========================================
- Coverage 90.16% 90.12% -0.04%
==========================================
Files 746 746
Lines 242660 242663 +3
Branches 45720 45722 +2
==========================================
- Hits 218793 218710 -83
- Misses 15360 15441 +81
- Partials 8507 8512 +5
🚀 New features to boost your workflow:
|
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.
On Windows and macOS, include matching resolves literal segments through the
filesystem, while array
excludepatterns are matched only against result pathstrings. Because exclude matchers inherited
nocaseMagicOnly: true, literalexclude patterns remained case-sensitive while patterns containing magic were
case-insensitive.
Pass
nocaseMagicOnly: falseonly when creating array exclude matchers. This isnarrower than #63446: include matcher construction and result casing remain
unchanged. Configurable case sensitivity is also left out of scope.
The new tests fail with v24.18.0 and pass with this change.
AI-assisted. Verified locally on Windows 11.
Fixes: #58991
Refs: #63446