Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handling of nested unignores #119

Merged
merged 1 commit into from
Nov 29, 2023
Merged

fix: handling of nested unignores #119

merged 1 commit into from
Nov 29, 2023

Conversation

mohd-akram
Copy link
Contributor

The fix in #116 was not quite complete. git does allow unignoring directories as long as its path to the root is unignored. This modifies the check to handle this case. The test case in nested-ignores.js was indeed wrong because it interpreted unignoring a specific file !/h/c/d/hcd as unignoring the directory !/h/c/d. I added new tests that specifically unignore a directory and therefore allow unignoring anything else within it.

References

Related to #116

@mohd-akram mohd-akram requested a review from a team as a code owner November 28, 2023 23:00
@mohd-akram mohd-akram changed the title fix: handling of nested ignores fix: handling of nested unignores Nov 29, 2023
@wraithgar
Copy link
Member

Good catch, and a good implementation.

@wraithgar wraithgar merged this pull request into npm:main Nov 29, 2023
27 checks passed
@github-actions github-actions bot mentioned this pull request Nov 29, 2023
wraithgar pushed a commit that referenced this pull request Nov 29, 2023
The fix in #116 was not quite complete. git does allow unignoring
directories as long as its path to the root is unignored. This modifies
the check to handle this case. The test case in `nested-ignores.js` was
indeed wrong because it interpreted unignoring a specific file
`!/h/c/d/hcd` as unignoring the directory `!/h/c/d`. I added new tests
that specifically unignore a directory and therefore allow unignoring
anything else within it.

## References
Related to #116
@mohd-akram mohd-akram deleted the fix-nested branch November 29, 2023 16:24
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.

2 participants