Fixes for handling .gitignore edge cases in GitIgnorePattern. #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The git client (tested with v2.4.1) exhibits differing behavior than pathspec's GitIgnorePattern, including:
/does NOT match all paths the repo/abs/pathmatches:abs/path/foospammatches:spam/,spam/foospam/twodoes NOT match:foo/spam/twospam/**does NOT match:foo/spam/barleft/**/rightdoes NOT match:foo/left/bar/right**/spamdoes match:foo/spam/,foo/spam/barfoo-*-bardoes match:foo-hello-bar/baz~temp-*does match:~temp-foo/bar*.pydoes match:bar.py/bazTests for each of these cases have been added. While some of these edge cases may be bugs in git, until they are fixed, I believe that pathspec should handle .gitignore files as close as possible to how git handles them. I marked these edge cases with
EDGE CASEcomments so that they can be easily removed in the future.More complex behavior, such as an include pattern followed by an exclude pattern were not tested since they would involve integration tests.
Thank you so much for creating this library!