-
Notifications
You must be signed in to change notification settings - Fork 49
Closed
Description
Behavior of pattern "match everything" changed when upgrading from version 0.9.0 to 0.10.0:
Version 0.9.0
>>> import pathspec
>>> patterns = pathspec.PathSpec.from_lines(pathspec.patterns.GitWildMatchPattern, ["*"])
>>>
>>> print(patterns.match_file('anydir/file.txt'))
TrueResult is as expected
Version 0.10.0
>>> import pathspec
>>> patterns = pathspec.PathSpec.from_lines(pathspec.patterns.GitWildMatchPattern, ["*"])
>>>
>>> print(patterns.match_file('anydir/file.txt'))
FalseResult is wrong. * should match any file, but it doesn't match anydir/file.txt.
Discovered when checking case "match everything except for one directory":
patterns = pathspec.PathSpec.from_lines(pathspec.patterns.GitWildMatchPattern, ["*", "!product_dir/"])On version 0.9.0 it correctly matches file outside of product_dir and doesn't match file inside:
>>> print(patterns.match_file('anydir/file.txt'))
True
>>> print(patterns.match_file('product_dir/file.txt'))
FalseOn version 0.10.0 it doesn't match in either case:
>>> print(patterns.match_file('anydir/file.txt'))
False
>>> print(patterns.match_file('product_dir/file.txt'))
FalseMetadata
Metadata
Assignees
Labels
No labels