From 070121c3332b02f2941e1da5eb381f78da1b7fd2 Mon Sep 17 00:00:00 2001 From: Filip Christiansen <22807962+filipchristiansen@users.noreply.github.com> Date: Mon, 17 Feb 2025 14:53:51 +0100 Subject: [PATCH] Remove redundant path resolution and enable rmtree error handling - Remove unnecessary _normalize_path(path.resolve()) calls, using path directly for ingestion - Remove ignore_errors=True from shutil.rmtree to allow proper error reporting --- src/gitingest/query_ingestion.py | 4 ++-- src/gitingest/repository_ingest.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gitingest/query_ingestion.py b/src/gitingest/query_ingestion.py index 11e2151a..e490ce15 100644 --- a/src/gitingest/query_ingestion.py +++ b/src/gitingest/query_ingestion.py @@ -897,6 +897,6 @@ def run_ingest_query(query: ParsedQuery) -> Tuple[str, str, str]: raise ValueError(f"{query.slug} cannot be found") if query.type and query.type == "blob": - return _ingest_single_file(_normalize_path(path.resolve()), query) + return _ingest_single_file(path, query) - return _ingest_directory(_normalize_path(path.resolve()), query) + return _ingest_directory(path, query) diff --git a/src/gitingest/repository_ingest.py b/src/gitingest/repository_ingest.py index b91950e0..73438cb7 100644 --- a/src/gitingest/repository_ingest.py +++ b/src/gitingest/repository_ingest.py @@ -96,7 +96,7 @@ async def ingest_async( # Clean up the temporary directory if it was created if parsed_query.url: # Clean up the temporary directory - shutil.rmtree(TMP_BASE_PATH, ignore_errors=True) + shutil.rmtree(TMP_BASE_PATH) def ingest(