Skip to content

Honor nested .gitignore negations (deepest match wins) - #5535

Open
Kayvan-Zahiri wants to merge 7 commits into
psf:mainfrom
Kayvan-Zahiri:fix/nested-gitignore-negation
Open

Kayvan-Zahiri wants to merge 7 commits into
psf:mainfrom
Kayvan-Zahiri:fix/nested-gitignore-negation

Conversation

@Kayvan-Zahiri

Copy link
Copy Markdown
Contributor

Summary

  • Change _path_is_ignored so the deepest .gitignore with a matching pattern decides (via GitIgnoreSpec.check_file), matching git.
  • Add a regression fixture for root ignore + nested negation (#5376).

Test plan

  • pytest tests/test_black.py -k gitignore
  • CI

Made with Cursor

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

diff-shades results comparing this PR (1f2543e) to main (b1c244d):

--preview style: no changes

--stable style: no changes


What is this? | Workflow run | diff-shades documentation

@cobaltt7 cobaltt7 added this to the File discovery milestone Nov 25, 2026

This branch has not been deployed

No deployments
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