The open source coding agent.
TypeScript
fix: ensure opencode still works if no commits present (#2363)
Aiden Clinea431b8922c9a
diff --git a/packages/opencode/src/project/project.ts b/packages/opencode/src/project/project.tsindex c61a5ca61d1..b6dfc58b76e 100644--- a/packages/opencode/src/project/project.ts+++ b/packages/opencode/src/project/project.ts@@ -53,6 +53,17 @@ export namespace Project {.map((x) => x.trim()).toSorted(),)+ if (!id) {+ const project: Info = {+ id: "global",+ worktree: "/",+ time: {+ created: Date.now(),+ },+ }+ await Storage.write<Info>(["project", "global"], project)+ return project+ }worktree = path.dirname(await $`git rev-parse --path-format=absolute --git-common-dir`.quiet()