Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/gitingest/ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,13 @@ def _process_node(

if query.ignore_patterns and _should_exclude(sub_path, query.local_path, query.ignore_patterns):
continue

if query.include_patterns and not _should_include(sub_path, query.local_path, query.include_patterns):
continue

# If an inclusion pattern exists, apply it only to files.
# Directories should be traversed as long as they are not excluded,
# because they may contain files that need to be included.
if query.include_patterns and sub_path.is_file():
if not _should_include(sub_path, query.local_path, query.include_patterns):
continue

if sub_path.is_symlink():
_process_symlink(path=sub_path, parent_node=node, stats=stats, local_path=query.local_path)
Expand Down