From e5c5f052b8d84f18c6b29095e9387e921f9b80c8 Mon Sep 17 00:00:00 2001 From: ix-56h Date: Tue, 15 Jul 2025 13:32:29 +0200 Subject: [PATCH] fix: gitignore and gitingestignore files are now correctly processed after the clone is done. --- src/gitingest/entrypoint.py | 5 ++--- src/gitingest/utils/ignore_patterns.py | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gitingest/entrypoint.py b/src/gitingest/entrypoint.py index f64dec08..026a27ec 100644 --- a/src/gitingest/entrypoint.py +++ b/src/gitingest/entrypoint.py @@ -83,15 +83,14 @@ async def ingest_async( token=token, ) - if not include_gitignored: - _apply_gitignores(query) - if query.url: _override_branch_and_tag(query, branch=branch, tag=tag) query.include_submodules = include_submodules async with _clone_repo_if_remote(query, token=token): + if not include_gitignored: + _apply_gitignores(query) summary, tree, content = ingest_query(query) await _write_output(tree, content=content, target=output) return summary, tree, content diff --git a/src/gitingest/utils/ignore_patterns.py b/src/gitingest/utils/ignore_patterns.py index 3fb0705d..5236e4d1 100644 --- a/src/gitingest/utils/ignore_patterns.py +++ b/src/gitingest/utils/ignore_patterns.py @@ -194,7 +194,6 @@ def load_ignore_patterns(root: Path, filename: str) -> set[str]: for ignore_file in root.rglob(filename): if ignore_file.is_file(): patterns.update(_parse_ignore_file(ignore_file, root)) - return patterns