You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Negation in a nested .gitignore fails to re-include a directory excluded by a parent .gitignore #7284
Then query whether a/vendor/f.txt is ignored, e.g. git_ignore_path_is_ignored(), or git_status with GIT_DIFF_INCLUDE_UNTRACKED.
Expected behavior
a/vendor/f.txt is not ignored, matching core git: the nested a/.gitignore negation !vendor re-includes the directory that the root **/vendor/ excluded. git check-ignore -v a/vendor/f.txt exits 1 (no match), and git ls-files --others --exclude-standard lists a/vendor/f.txt.
Actual behavior
libgit2 reports a/vendor/f.txt as ignored (git_ignore_path_is_ignored returns 1; the
file is omitted from the untracked set under GIT_DIFF_INCLUDE_UNTRACKED).
The negation is honored when it lives in the same.gitignore as the exclude — i.e.
root .gitignore of **/vendor/ + !a/vendor correctly yields not-ignored. The divergence
appears only when the negation is in a nested (child-directory) .gitignore. (vendor/
instead of **/vendor/ reproduces it too.)
Activity