From 85f15893bcd528d3a1bf33681f42abe5210e7ebd Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Tue, 11 Nov 2025 15:11:26 -0500 Subject: [PATCH] core: prevent crash when starting in repositories without any commits yet --- packages/opencode/src/project/project.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/project/project.ts b/packages/opencode/src/project/project.ts index 8d94a5a1..381559e8 100644 --- a/packages/opencode/src/project/project.ts +++ b/packages/opencode/src/project/project.ts @@ -60,7 +60,7 @@ export namespace Project { .toSorted(), ) id = roots[0] - Bun.file(path.join(git, "opencode")).write(id) + if (id) Bun.file(path.join(git, "opencode")).write(id) } timer.stop() if (!id) {