| author | |
| committer | |
| log | 77fcad3586a372878304c108d082662706a32f56 |
| tree | 7b4da9db4273e3f4db63500e7ca0b570640b07c4 |
| parent | 801b83e9372cd5ccd7803c3137db7ba24f7bf897 |
| signature | Signed by PGP key B5690EEEBB952194 |
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", () => { | ... | @@ -1020,6 +1020,15 @@ describe("resolveLiveThreadBranchUpdate", () => { |
| 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", () => { |
apps/web/src/components/GitActionsControl.logic.ts+10| ... | @@ -3,6 +3,7 @@ import type { | ... | @@ -3,6 +3,7 @@ import type { |
| 3 | GitStackedAction, | 3 | GitStackedAction, |
| 4 | GitStatusResult, | 4 | GitStatusResult, |
| 5 | } from "@t3tools/contracts"; | 5 | } from "@t3tools/contracts"; |
| 6 | import { isTemporaryWorktreeBranch } from "@t3tools/shared/git"; | ||
| 6 | 7 | ||
| 7 | export type GitActionIconName = "commit" | "push" | "pr"; | 8 | export type GitActionIconName = "commit" | "push" | "pr"; |
| 8 | 9 | ||
| ... | @@ -354,6 +355,15 @@ export function resolveLiveThreadBranchUpdate(input: { | ... | @@ -354,6 +355,15 @@ export function resolveLiveThreadBranchUpdate(input: { |
| 354 | return null; | 355 | return null; |
| 355 | } | 356 | } |
| 356 | 357 | ||
| 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 | |||
| 357 | return { | 367 | return { |
| 358 | branch: input.gitStatus.branch, | 368 | branch: input.gitStatus.branch, |
| 359 | }; | 369 | }; |