diff --git a/apps/web/src/components/GitActionsControl.logic.test.ts b/apps/web/src/components/GitActionsControl.logic.test.ts index 267cbec180..c6a50b82c2 100644 --- a/apps/web/src/components/GitActionsControl.logic.test.ts +++ b/apps/web/src/components/GitActionsControl.logic.test.ts @@ -1020,6 +1020,15 @@ describe("resolveLiveThreadBranchUpdate", () => { assert.equal(update, null); }); + + it("does not regress a semantic thread branch back to a temporary worktree branch", () => { + const update = resolveLiveThreadBranchUpdate({ + threadBranch: "t3code/github-query-rate-limit", + gitStatus: status({ branch: "t3code/bda76797" }), + }); + + assert.equal(update, null); + }); }); describe("resolveAutoFeatureBranchName", () => { diff --git a/apps/web/src/components/GitActionsControl.logic.ts b/apps/web/src/components/GitActionsControl.logic.ts index c5323dcfd2..96663172f4 100644 --- a/apps/web/src/components/GitActionsControl.logic.ts +++ b/apps/web/src/components/GitActionsControl.logic.ts @@ -12,5 +12,4 @@ export { resolveQuickAction, resolveThreadBranchUpdate, } from "@t3tools/client-runtime"; - export { resolveAutoFeatureBranchName } from "@t3tools/shared/git"; diff --git a/packages/client-runtime/src/gitActions.ts b/packages/client-runtime/src/gitActions.ts index 97bd22557e..e6f3a15000 100644 --- a/packages/client-runtime/src/gitActions.ts +++ b/packages/client-runtime/src/gitActions.ts @@ -4,6 +4,7 @@ import type { GitStackedAction, GitStatusResult, } from "@t3tools/contracts"; +import { isTemporaryWorktreeBranch } from "@t3tools/shared/git"; export type GitActionIconName = "commit" | "push" | "pr"; @@ -424,6 +425,15 @@ export function resolveLiveThreadBranchUpdate(input: { return null; } + if ( + input.threadBranch !== null && + input.gitStatus.branch !== null && + !isTemporaryWorktreeBranch(input.threadBranch) && + isTemporaryWorktreeBranch(input.gitStatus.branch) + ) { + return null; + } + return { branch: input.gitStatus.branch, };