Skip to content

Commit 2092a2d

Browse files
cyclotrucfilipchristiansen
authored andcommitted
remove subpath hack (#219)
Signed-off-by: Filip Christiansen <[email protected]>
1 parent d09efde commit 2092a2d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/gitingest/cloning.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ async def clone_repo(config: CloneConfig) -> None:
101101

102102
if partial_clone:
103103
if config.blob:
104-
checkout_cmd += ["sparse-checkout", "set", config.subpath.lstrip("/")[:-1]]
104+
# When ingesting from a file url (blob/branch/path/file.txt), we need to remove the file name
105+
checkout_cmd += ["sparse-checkout", "set", Path(config.subpath.lstrip("/")).parent]
105106
else:
106107
checkout_cmd += ["sparse-checkout", "set", config.subpath.lstrip("/")]
107108

0 commit comments

Comments
 (0)