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()))
|
.then((x) => path.resolve(worktree, x.trim()))
|
||||||
const projectID = id || "global"
|
const projectID = id || "global"
|
||||||
const existing = id ? await Storage.read<Info>(["project", id]).catch(() => undefined) : undefined
|
const existing = id ? await Storage.read<Info>(["project", id]).catch(() => undefined) : undefined
|
||||||
if (!existing) {
|
if (!existing && id) {
|
||||||
await migrateFromGlobal(projectID, worktree)
|
await migrateFromGlobal(projectID, worktree)
|
||||||
}
|
}
|
||||||
const project: Info = {
|
const project: Info = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue