Skip to content

Commit 65b4b4a

Browse files
committed
Fix blob ingests
1 parent df19539 commit 65b4b4a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/gitingest/ingest_from_query.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,9 @@ def ingest_directory(path: str, query: dict[str, Any]) -> tuple[str, str, str]:
394394

395395
def ingest_from_query(query: dict[str, Any]) -> tuple[str, str, str]:
396396
"""Main entry point for analyzing a codebase directory or single file."""
397-
path = f"{query['local_path']}{query['subpath']}"
398-
if not os.path.exists(path):
399-
raise ValueError(f"{query['slug']} cannot be found")
397+
path = os.path.join(query["local_path"], query["subpath"].lstrip(os.sep))
398+
if not os.path.exists(path) and not os.path.exists(os.path.dirname(path)):
399+
raise ValueError(f"{query['subpath']} cannot be found")
400400

401401
if query.get("type") == "blob":
402402
return ingest_single_file(path, query)

0 commit comments

Comments
 (0)