Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/gitingest/ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from gitingest.utils.path_utils import _is_safe_symlink

try:
import tomllib
import tomllib # type: ignore[import]
except ImportError:
import tomli as tomllib

Expand Down
3 changes: 3 additions & 0 deletions src/gitingest/query_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ def _parse_patterns(pattern: Union[str, Set[str]]) -> Set[str]:
# Remove empty string if present
parsed_patterns = parsed_patterns - {""}

# Normalize Windows paths to Unix-style paths
parsed_patterns = {p.replace("\\", "/") for p in parsed_patterns}

# Validate and normalize each pattern
for p in parsed_patterns:
if not _is_valid_pattern(p):
Expand Down
3 changes: 3 additions & 0 deletions src/gitingest/utils/ingestion_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def _should_include(path: Path, base_path: Path, include_patterns: Set[str]) ->
return False

rel_str = str(rel_path)
if path.is_dir():
rel_str += "/"

for pattern in include_patterns:
if fnmatch(rel_str, pattern):
return True
Expand Down
Loading