Skip to content

Commit

Permalink
Little bit faster. #24 cpburnz/python-pathspec#38
Browse files Browse the repository at this point in the history
  • Loading branch information
excitoon committed Aug 28, 2022
1 parent e42f590 commit ab030ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gitignorefile/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ def _handle_negation(file_path, rules, base_path=None, is_dir=None):
matched = False
for rule in rules:
if rule.match(rel_path, is_dir):
matched = not rule.negation
if matched and return_immediately:
if return_immediately:
return True

matched = not rule.negation

else:
return matched

Expand Down

0 comments on commit ab030ae

Please sign in to comment.