Skip to content

Commit 5396348

Browse files
Update packages/web/src/features/git/getTreeApi.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent ad108dd commit 5396348

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

packages/web/src/features/git/getTreeApi.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ export const getTree = async ({ repoName, revisionName, paths }: GetTreeRequest)
7474

7575
const flatList = lines.map(line => {
7676
const commaIndex = line.indexOf(',');
77+
if (commaIndex === -1) {
78+
throw new Error(`Unexpected ls-tree output: ${line}`);
79+
}
7780
const type = line.substring(0, commaIndex);
7881
const path = line.substring(commaIndex + 1);
7982
return {

0 commit comments

Comments
 (0)