Skip to content

Commit 70c25b9

Browse files
committed
fix: branching
1 parent 623754a commit 70c25b9

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/web/src/workers/gitWorker.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,15 @@ async function handleListFiles(id: number, ref: string): Promise<ResOk> {
319319
await pfs.readdir(full)
320320
await walk(full)
321321
} catch {
322-
out.push(full.slice(1))
322+
const filePath = full.slice(1)
323+
// Respect .gitignore by consulting git's own ignore logic
324+
try {
325+
const git = await getGit()
326+
const ignored = await (git as any).isIgnored?.({ fs: lfs, dir: '/', filepath: filePath })
327+
if (!ignored) out.push(filePath)
328+
} catch {
329+
out.push(filePath) // graceful fallback
330+
}
323331
}
324332
}
325333
}

0 commit comments

Comments
 (0)