Skip to content

Commit 5808b72

Browse files
committed
🐛 Fix blob URL of files in nested tree
1 parent b68b21e commit 5808b72

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

object_url.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ async function getObjectType(
4040
["ls-tree", "-t", commitish, path],
4141
options,
4242
);
43-
return stdout.trim().split("\n").at(0)?.split(" ").at(1) as ObjectType;
43+
return stdout
44+
.trim()
45+
.split("\n")
46+
.find((line) => line.includes(path))
47+
?.split(" ")
48+
.at(1) as ObjectType;
4449
}
4550

4651
function parsePath(path: string): [string, Range | undefined] {

0 commit comments

Comments
 (0)