Unified · Split
| @@ -1020,6 +1020,15 @@ describe("resolveLiveThreadBranchUpdate", () => { · 1019 unmodified lines | ||
| 1020 | 1020 | |
| 1021 | 1021 | assert.equal(update, null); |
| 1022 | 1022 | }); |
| 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 | + }); | |
| 1023 | 1032 | }); |
| 1024 | 1033 | |
| 1025 | 1034 | describe("resolveAutoFeatureBranchName", () => { |
| @@ -12,5 +12,4 @@ export { · 11 unmodified lines | ||
| 12 | 12 | resolveQuickAction, |
| 13 | 13 | resolveThreadBranchUpdate, |
| 14 | 14 | } from "@t3tools/client-runtime"; |
| 15 | − | |
| 16 | 15 | export { resolveAutoFeatureBranchName } from "@t3tools/shared/git"; |
| @@ -4,6 +4,7 @@ import type { · 3 unmodified lines | ||
| 4 | 4 | GitStackedAction, |
| 5 | 5 | GitStatusResult, |
| 6 | 6 | } from "@t3tools/contracts"; |
| 7 | +import { isTemporaryWorktreeBranch } from "@t3tools/shared/git"; | |
| 7 | 8 | |
| 8 | 9 | export type GitActionIconName = "commit" | "push" | "pr"; |
| 9 | 10 | |
| @@ -424,6 +425,15 @@ export function resolveLiveThreadBranchUpdate(input: { · 414 unmodified lines | ||
| 424 | 425 | return null; |
| 425 | 426 | } |
| 426 | 427 | |
| 428 | + if ( | |
| 429 | + input.threadBranch !== null && | |
| 430 | + input.gitStatus.branch !== null && | |
| 431 | + !isTemporaryWorktreeBranch(input.threadBranch) && | |
| 432 | + isTemporaryWorktreeBranch(input.gitStatus.branch) | |
| 433 | + ) { | |
| 434 | + return null; | |
| 435 | + } | |
| 436 | + | |
| 427 | 437 | return { |
| 428 | 438 | branch: input.gitStatus.branch, |
| 429 | 439 | }; |