Skip to content

fs: apply nocase to literal glob exclude patterns - #64817

Open
yhay81 wants to merge 1 commit into
nodejs:mainfrom
yhay81:fix-58991-glob-exclude-nocase
Open

fs: apply nocase to literal glob exclude patterns#64817
yhay81 wants to merge 1 commit into
nodejs:mainfrom
yhay81:fix-58991-glob-exclude-nocase

Conversation

@yhay81

@yhay81 yhay81 commented Jul 29, 2026

Copy link
Copy Markdown

On Windows and macOS, include matching resolves literal segments through the
filesystem, while array exclude patterns are matched only against result path
strings. Because exclude matchers inherited nocaseMagicOnly: true, literal
exclude patterns remained case-sensitive while patterns containing magic were
case-insensitive.

Pass nocaseMagicOnly: false only when creating array exclude matchers. This is
narrower 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

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>
@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fs.glob excludes patterns and input pattern uses different casing (case-sensitive) windows

2 participants