Skip to content

Add test for absolute paths in checkIgnore - #1085

Merged
steveukx merged 8 commits into
mainfrom
feat/1077_windows-paths-with-quotes
Oct 28, 2025
Merged

steveukx merged 8 commits into
mainfrom
feat/1077_windows-paths-with-quotes

Conversation

@steveukx

@steveukx steveukx commented Oct 28, 2025 •

Copy link
Copy Markdown
Owner

Extends #1084 to test the use of absolute paths in git.checkIgnore():

Handles the git binary wrapping paths with double quotes, resulting in double \\ separators appearing in the returned values.

Following this change, all paths returned from checkIgnore will be normalized.

const absolute = join( git.revparse('--show-toplevel'), 'node_modules', 'file' );
const relative = join( 'node_modules', 'file' );

const ignored = git.checkIgnore( [ absolute, relative ] );
expect(ignored).toEqual([ absolute, relative ] )

@changeset-bot

changeset-bot Bot commented Oct 28, 2025 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0a1c3b5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
simple-git Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@steveukx
steveukx merged commit 240ec64 into main Oct 28, 2025
9 checks passed
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.

1 participant