Skip to content

fix: handle Windows rooted negative patterns - #523

Open
LeulTew wants to merge 1 commit into
mrmlnc:masterfrom
LeulTew:leultew-windows-absolute-glob-exclusions
Open

LeulTew wants to merge 1 commit into
mrmlnc:masterfrom
LeulTew:leultew-windows-absolute-glob-exclusions

Conversation

@LeulTew

@LeulTew LeulTew commented Sep 16, 2026

Copy link
Copy Markdown

What is the purpose of this pull request?

Fix Windows rooted absolute exclusions so matching positive and negative patterns cancel with or without a drive letter. Fixes #486.

What changes did you make? (Give an overview)

Resolve only the root of single-slash Windows negative patterns against cwd, preserving glob syntax and explicit drive/UNC roots. Add regression coverage and clarify the Windows pattern documentation.

Validation was local to Windows with Node.js 26.3.0. Linux/macOS, other Node.js versions, and physically mounted secondary drives or UNC shares were not exercised.

Implementation and validation

Absolute negative patterns were compiled without a drive while candidate paths were resolved to drive-qualified paths. Prefixing only the escaped filesystem root reconciles these forms without passing glob expressions through path.resolve.

The public globSync reproduction returned the fixture before the fix and returns [] after it; the drive-qualified control returns [] in both cases. Before the fix, 7 new unit checks and 54 new sync/async/stream checks failed.

  • npm run build: passes compilation/type checking, lint, and 292 unit tests.
  • SNAPSHOT_SKIP_PRUNING=1 npm run test:e2e -- --reporter dot: 1,449 passing; 9 existing platform-specific pending cases.
  • Focused entry-filter and absolute-option suites: 40 and 120 passing respectively, including 12 new unit tests and 69 new public API checks.
  • git diff --check: passes.

Coverage includes rooted and drive-qualified positives, negative patterns and ignore, relative/absolute/URL cwd, relative exclusions, nonmatches, output and case settings, hidden files, trailing directory slashes, braces, extglobs, character classes, escaping, and parent segments. Synthetic entry-filter cases exercise distinct drives, literal UNC share metacharacters, explicit UNC roots, and device-drive roots without accessing other drives or network shares.

Resolve rooted absolute exclusions against the cwd drive or UNC share without normalizing glob syntax.
@mergify

mergify Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v3.3.3 breaks negative absolute patterns without a drive letter on Windows

1 participant