From d1dbe55e2a92a11cebdcca2cfe7e30eba8d32e62 Mon Sep 17 00:00:00 2001 From: cyclotruc Date: Thu, 6 Mar 2025 22:33:11 +0000 Subject: [PATCH] remove subpath hack --- src/gitingest/cloning.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gitingest/cloning.py b/src/gitingest/cloning.py index e702115f..ffd933c1 100644 --- a/src/gitingest/cloning.py +++ b/src/gitingest/cloning.py @@ -101,7 +101,8 @@ async def clone_repo(config: CloneConfig) -> None: if partial_clone: if config.blob: - checkout_cmd += ["sparse-checkout", "set", config.subpath.lstrip("/")[:-1]] + # When ingesting from a file url (blob/branch/path/file.txt), we need to remove the file name + checkout_cmd += ["sparse-checkout", "set", Path(config.subpath.lstrip("/")).parent] else: checkout_cmd += ["sparse-checkout", "set", config.subpath.lstrip("/")]