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