Skip to content

Commit 973c556

Browse files
authored
Add an implicit ".git/" line which git does internally.
1 parent b8d1872 commit 973c556

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gitignore_parser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ def handle_negation(file_path, rules: Reversible["IgnoreRule"]):
1515
def parse_gitignore(full_path, base_dir=None):
1616
if base_dir is None:
1717
base_dir = dirname(full_path)
18-
rules = []
18+
rules = [
19+
rule_from_pattern(".git/", base_path=_normalize_path(base_dir),
20+
source=(full_path, -1)),
21+
]
1922
with open(full_path) as ignore_file:
2023
counter = 0
2124
for line in ignore_file:

0 commit comments

Comments
 (0)