mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
core: fix project event emission to include updated worktree data
This commit is contained in:
parent
c5e5627cbd
commit
f1955b4d05
2 changed files with 6 additions and 5 deletions
|
|
@ -108,7 +108,7 @@ export namespace Project {
|
|||
}
|
||||
}
|
||||
discover(existing)
|
||||
await Storage.write<Info>(["project", id], {
|
||||
const result: Info = {
|
||||
...existing,
|
||||
worktree,
|
||||
vcs: vcs as Info["vcs"],
|
||||
|
|
@ -116,14 +116,15 @@ export namespace Project {
|
|||
...existing.time,
|
||||
updated: Date.now(),
|
||||
},
|
||||
})
|
||||
}
|
||||
await Storage.write<Info>(["project", id], result)
|
||||
GlobalBus.emit("event", {
|
||||
payload: {
|
||||
type: Event.Updated.type,
|
||||
properties: existing,
|
||||
properties: result,
|
||||
},
|
||||
})
|
||||
return existing
|
||||
return result
|
||||
}
|
||||
|
||||
export async function discover(input: Info) {
|
||||
|
|
|
|||
|
|
@ -469,7 +469,7 @@ test("snapshot state isolation between projects", async () => {
|
|||
})
|
||||
})
|
||||
|
||||
test.only("patch detects changes in secondary worktree", async () => {
|
||||
test("patch detects changes in secondary worktree", async () => {
|
||||
await using tmp = await bootstrap()
|
||||
const worktreePath = `${tmp.path}-worktree`
|
||||
await $`git worktree add ${worktreePath} HEAD`.cwd(tmp.path).quiet()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue