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

A pattern with only a trailing slash should be treated as a glob #529

Closed

Conversation

segevfiner
Copy link
Contributor

A pattern like "bar/" should still ignore "foo/bar/", but "/bar/" should
not.

Related issue: #526

Reproduction

git init temp && cd temp
mkdir -p test/foo
cat > .gitignore <<EOF
foo/
EOF
git check-ignore -v test/foo

Output:

.gitignore:1:foo/       test/foo

(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/foo/')
# None

A pattern like "bar/" should still ignore "foo/bar/", but "/bar/" should
not.
@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-trailing-slash-glob 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