mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
core: prevent sessions from disappearing after git init
Previously, sessions created in a non-git directory would disappear from the session picker after running git init and making the first commit. This happened because the migration logic ran prematurely before a stable project ID existed.
This commit is contained in:
parent
e0f77940f9
commit
aa884b003e
1 changed files with 1 additions and 1 deletions
|
|
@ -80,7 +80,7 @@ export namespace Project {
|
|||
.then((x) => path.resolve(worktree, x.trim()))
|
||||
const projectID = id || "global"
|
||||
const existing = id ? await Storage.read<Info>(["project", id]).catch(() => undefined) : undefined
|
||||
if (!existing) {
|
||||
if (!existing && id) {
|
||||
await migrateFromGlobal(projectID, worktree)
|
||||
}
|
||||
const project: Info = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue