Skip to content

Commit ad108dd

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

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ export const getFolderContents = async ({ repoName, revisionName, path }: GetFol
6060

6161
const contents: FileTreeItem[] = lines.map(line => {
6262
const commaIndex = line.indexOf(',');
63+
if (commaIndex === -1) {
64+
throw new Error(`Unexpected ls-tree output: ${line}`);
65+
}
6366
const type = line.substring(0, commaIndex);
6467
const path = line.substring(commaIndex + 1);
6568
const name = path.split('/').pop() ?? '';

0 commit comments

Comments
 (0)