Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): don't seed the worktree base from an unborn HEAD #25721

Closedmatheustimbo(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/25721/headopened View on GitHub

Showing 3 changed files with 74 additions and 4 deletions.

x
0 of 3 viewed, 3 left
51 additions and 0 deletionsapps/web/src/components/BranchToolbar.logic.test.tsModified
View file
@@ -8,6 +8,7 @@
resolveEffectiveEnvMode,
resolveBranchToolbarPrBranch,
resolveLocalCheckoutBranchMismatch,
+ resolveWorktreeBaseBranchCandidate,
sanitizeNewRefName,
shouldIncludeBranchPickerItem,
} from "./BranchToolbar.logic";
@@ -254,3 +255,53 @@
expect(sanitizeNewRefName("foo--bar")).toBe("foo--bar");
});
});
+​
+describe("resolveWorktreeBaseBranchCandidate", () => {
+ const ref = (name: string, overrides: Partial<VcsRef> = {}): VcsRef => ({
+ name,
+ current: false,
+ isDefault: false,
+ worktreePath: null,
+ ...overrides,
+ });
+​
+ it("waits for the initial ref list", () => {
+ expect(
+ resolveWorktreeBaseBranchCandidate({
+ isInitialBranchesLoadPending: true,
+ refs: [],
+ currentGitBranch: "staging",
+ }),