diff options
| author | Aiden Cline <[email protected]> | 2025-09-01 19:57:14 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-09-01 20:57:14 -0400 |
| commit | a431b8922c9afd4acc0125dc2a495a74e1b43693 (patch) | |
| tree | 5bf8fa01e598ca2b1cef73082ff6c461ecc0f978 | |
| parent | 0a01d2085099d8d0cbe52aa039a81f056d754fcb (diff) | |
| download | opencode-a431b8922c9afd4acc0125dc2a495a74e1b43693.tar.gz opencode-a431b8922c9afd4acc0125dc2a495a74e1b43693.zip | |
fix: ensure opencode still works if no commits present (#2363)
| -rw-r--r-- | packages/opencode/src/project/project.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/opencode/src/project/project.ts b/packages/opencode/src/project/project.ts index c61a5ca61..b6dfc58b7 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() |
