We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b925eba commit e5e116dCopy full SHA for e5e116d
1 file changed
gitignore_parser.py
@@ -4,17 +4,13 @@
4
5
from os.path import dirname
6
from pathlib import Path
7
-from typing import Union
+from typing import Reversible, Union
8
9
-def handle_negation(file_path, rules):
10
- matched = False
11
- for rule in rules:
+def handle_negation(file_path, rules: Reversible["IgnoreRule"]):
+ for rule in reversed(rules):
12
if rule.match(file_path):
13
- if rule.negation:
14
15
- else:
16
- matched = True
17
- return matched
+ return not rule.negation
+ return False
18
19
def parse_gitignore(full_path, base_dir=None):
20
if base_dir is None:
0 commit comments