Skip to content

Commit d8fb123

Browse files
refactor: simplify logic in _should_exclude function in ingest_from_query.py
1 parent 25373b5 commit d8fb123

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/gitingest/ingest_from_query.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ def _should_include(path: str, base_path: str, include_patterns: list[str]) -> b
2222
def _should_exclude(path: str, base_path: str, ignore_patterns: list[str]) -> bool:
2323
rel_path = path.replace(base_path, "").lstrip(os.sep)
2424
for pattern in ignore_patterns:
25-
if pattern == "":
26-
continue
27-
if fnmatch(rel_path, pattern):
25+
if pattern and fnmatch(rel_path, pattern):
2826
return True
2927
return False
3028

@@ -68,6 +66,7 @@ def _scan_directory(
6866
"""Recursively analyzes a directory and its contents with safety limits."""
6967
if seen_paths is None:
7068
seen_paths = set()
69+
7170
if stats is None:
7271
stats = {"total_files": 0, "total_size": 0}
7372

0 commit comments

Comments
 (0)