Skip to content

Commit ee8a351

Browse files
authored
remove subpath hack (#219)
1 parent f29213c commit ee8a351

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)