authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-04-13 12:04:56-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-04-13 19:04:56+00:00
log77fcad3586a372878304c108d082662706a32f56
tree7b4da9db4273e3f4db63500e7ca0b570640b07c4
parent801b83e9372cd5ccd7803c3137db7ba24f7bf897
signature Signed by PGP key B5690EEEBB952194

Prevent live thread branches from regressing to temp worktree names (#1995)

Co-authored-by: codex <codex@users.noreply.github.com>

2 files changed, 19 insertions(+), 0 deletions(-)

apps/web/src/components/GitActionsControl.logic.test.ts+9
......@@ -1020,6 +1020,15 @@ describe("resolveLiveThreadBranchUpdate", () => {
10201020
10211021 assert.equal(update, null);
10221022 });
1023
1024 it("does not regress a semantic thread branch back to a temporary worktree branch", () => {
1025 const update = resolveLiveThreadBranchUpdate({
1026 threadBranch: "t3code/github-query-rate-limit",
1027 gitStatus: status({ branch: "t3code/bda76797" }),
1028 });
1029
1030 assert.equal(update, null);
1031 });
10231032});
10241033
10251034describe("resolveAutoFeatureBranchName", () => {
apps/web/src/components/GitActionsControl.logic.ts+10
......@@ -3,6 +3,7 @@ import type {
33 GitStackedAction,
44 GitStatusResult,
55} from "@t3tools/contracts";
6import { isTemporaryWorktreeBranch } from "@t3tools/shared/git";
67
78export type GitActionIconName = "commit" | "push" | "pr";
89
......@@ -354,6 +355,15 @@ export function resolveLiveThreadBranchUpdate(input: {
354355 return null;
355356 }
356357
358 if (
359 input.threadBranch !== null &&
360 input.gitStatus.branch !== null &&
361 !isTemporaryWorktreeBranch(input.threadBranch) &&
362 isTemporaryWorktreeBranch(input.gitStatus.branch)
363 ) {
364 return null;
365 }
366
357367 return {
358368 branch: input.gitStatus.branch,
359369 };