Prevent live thread branches from regressing to temp worktree names (#1995)
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
cea78b1215
commit
f7535bb36c
3 files changed
+19
-1
No files matched your search
@@ -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", () => {
|
||||
|
||||
@@ -12,5 +12,4 @@ export {
|
||||
resolveQuickAction,
|
||||
resolveThreadBranchUpdate,
|
||||
} from "@t3tools/client-runtime";
|
||||
|
||||
export { resolveAutoFeatureBranchName } from "@t3tools/shared/git";
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user