diff options
| author | Shoubhit Dash <[email protected]> | 2026-03-26 19:44:57 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-26 10:14:57 -0400 |
| commit | 1b028d0632c78a9061d8c235e329313b8f41646f (patch) | |
| tree | a90b3e735aa648dfdb843d5b3f7352164e63cbe8 /packages/app/src/context/global-sync | |
| parent | d500a8432a690e802edcc065df84a9c9ec8c3652 (diff) | |
| download | opencode-1b028d0632c78a9061d8c235e329313b8f41646f.tar.gz opencode-1b028d0632c78a9061d8c235e329313b8f41646f.zip | |
revert: roll back git-backed review modes (#19295)
Diffstat (limited to 'packages/app/src/context/global-sync')
| -rw-r--r-- | packages/app/src/context/global-sync/bootstrap.ts | 2 | ||||
| -rw-r--r-- | packages/app/src/context/global-sync/event-reducer.test.ts | 10 | ||||
| -rw-r--r-- | packages/app/src/context/global-sync/event-reducer.ts | 4 |
3 files changed, 7 insertions, 9 deletions
diff --git a/packages/app/src/context/global-sync/bootstrap.ts b/packages/app/src/context/global-sync/bootstrap.ts index 4790011a5..6eec688b7 100644 --- a/packages/app/src/context/global-sync/bootstrap.ts +++ b/packages/app/src/context/global-sync/bootstrap.ts @@ -190,7 +190,7 @@ export async function bootstrapDirectory(input: { input.sdk.vcs.get().then((x) => { const next = x.data ?? input.store.vcs input.setStore("vcs", next) - if (next) input.vcsCache.setStore("value", next) + if (next?.branch) input.vcsCache.setStore("value", next) }), ), () => retry(() => input.sdk.command.list().then((x) => input.setStore("command", x.data ?? []))), diff --git a/packages/app/src/context/global-sync/event-reducer.test.ts b/packages/app/src/context/global-sync/event-reducer.test.ts index 892129788..cf2da135c 100644 --- a/packages/app/src/context/global-sync/event-reducer.test.ts +++ b/packages/app/src/context/global-sync/event-reducer.test.ts @@ -494,10 +494,8 @@ describe("applyDirectoryEvent", () => { }) test("updates vcs branch in store and cache", () => { - const [store, setStore] = createStore(baseState({ vcs: { branch: "main", default_branch: "main" } })) - const [cacheStore, setCacheStore] = createStore({ - value: { branch: "main", default_branch: "main" } as State["vcs"], - }) + const [store, setStore] = createStore(baseState()) + const [cacheStore, setCacheStore] = createStore({ value: undefined as State["vcs"] }) applyDirectoryEvent({ event: { type: "vcs.branch.updated", properties: { branch: "feature/test" } }, @@ -513,8 +511,8 @@ describe("applyDirectoryEvent", () => { }, }) - expect(store.vcs).toEqual({ branch: "feature/test", default_branch: "main" }) - expect(cacheStore.value).toEqual({ branch: "feature/test", default_branch: "main" }) + expect(store.vcs).toEqual({ branch: "feature/test" }) + expect(cacheStore.value).toEqual({ branch: "feature/test" }) }) test("routes disposal and lsp events to side-effect handlers", () => { diff --git a/packages/app/src/context/global-sync/event-reducer.ts b/packages/app/src/context/global-sync/event-reducer.ts index 4af636553..5d8b7c4e3 100644 --- a/packages/app/src/context/global-sync/event-reducer.ts +++ b/packages/app/src/context/global-sync/event-reducer.ts @@ -271,9 +271,9 @@ export function applyDirectoryEvent(input: { break } case "vcs.branch.updated": { - const props = event.properties as { branch?: string } + const props = event.properties as { branch: string } if (input.store.vcs?.branch === props.branch) break - const next = { ...input.store.vcs, branch: props.branch } + const next = { branch: props.branch } input.setStore("vcs", next) if (input.vcsCache) input.vcsCache.setStore("value", next) break |
