summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-11-11 15:11:26 -0500
committerDax Raad <[email protected]>2025-11-11 15:11:42 -0500
commit85f15893bcd528d3a1bf33681f42abe5210e7ebd (patch)
tree9a7ed26dfb58d25c381ae1d206b3ab7224c51ee9
parent98be75b17c839bd003807681234f33be5d655fbd (diff)
downloadopencode-85f15893bcd528d3a1bf33681f42abe5210e7ebd.tar.gz
opencode-85f15893bcd528d3a1bf33681f42abe5210e7ebd.zip
core: prevent crash when starting in repositories without any commits yet
-rw-r--r--packages/opencode/src/project/project.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/opencode/src/project/project.ts b/packages/opencode/src/project/project.ts
index 8d94a5a12..381559e80 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) {