Skip to content

Commit e669e44

Browse files
fix: temp files cleanup after ingest(#309)
Co-authored-by: Romain Courtois <[email protected]>
1 parent d099de5 commit e669e44

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/gitingest/entrypoint.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from pathlib import Path
1010

1111
from gitingest.clone import clone_repo
12-
from gitingest.config import MAX_FILE_SIZE, TMP_BASE_PATH
12+
from gitingest.config import MAX_FILE_SIZE
1313
from gitingest.ingestion import ingest_query
1414
from gitingest.query_parser import IngestionQuery, parse_query
1515
from gitingest.utils.auth import resolve_token
@@ -91,9 +91,9 @@ async def ingest_async(
9191

9292
return summary, tree, content
9393
finally:
94-
# Clean up the temporary directory if it was created
94+
# Clean up the temporary directory for the repository
9595
if repo_cloned:
96-
shutil.rmtree(TMP_BASE_PATH, ignore_errors=True)
96+
shutil.rmtree(query.local_path.parent)
9797

9898

9999
def ingest(

0 commit comments

Comments
 (0)