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

Correctly handle include, exclude than include in .gitignore #528

Closed

Conversation

segevfiner
Copy link
Contributor

@segevfiner segevfiner commented Jul 4, 2017

For example, for a .gitignore file like:

test
!test
test

"test" should be ignored.

Related issue: #526

Reproduction

git init temp && cd temp
touch test
cat > .gitignore <<EOF
test
!test
test
EOF
git check-ignore -v test

Output:

.gitignore:3:test       test

(The file is ignored)

Dulwich (before fix):

>>> from dulwich import ignore
>>> with open('.gitignore', 'r') as f:
...     a = ignore.IgnoreFilter(ignore.read_ignore_patterns(f))
...
>>> a.is_ignored('test')
False

For example, for a .gitignore file like:
test
!test
test

"test" should be ignored.
@segevfiner segevfiner mentioned this pull request Jul 4, 2017
9 tasks
@jelmer
Copy link
Owner

jelmer commented Jul 5, 2017

Merged, thanks!

@jelmer jelmer closed this Jul 5, 2017
@segevfiner segevfiner deleted the gitignore-include-exclude-include branch July 5, 2017 04:18
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