Repository navigation
fix(web): a new worktree's row names its real base, not the checkout's branch - #1025
Merged
Merged
Conversation
…s branch While the "New worktrees from" setting's branch was still loading (the branch list can take seconds), the row under the message box showed the checkout's current branch. The worktree then started from the setting's branch, which can be a different one. The row now shows, in order: a picked branch; the setting's branch once found; while the lookup runs, the branch the setting will give when that's knowable without the list (predictNewWorktreeBaseBranch: the checkout's branch for "current", the name for "named", the checkout's branch for "default" only when git status says it is the default); otherwise "the default branch" / "the current branch" in words, or "…" before the computer's settings arrive; and "pick a branch" when nothing fits, including when the lookup failed (which now counts as no base rather than loading). resolveBranchToolbarValue no longer falls back to the checkout's branch for a new worktree; its test that expected that fallback now expects the opposite.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 20, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In New worktree mode, the row under the message box ("Runs in a new worktree from X", or the "From X" chip) showed the checkout's current branch while the "New worktrees from" setting's branch was still loading. On a busy repository that list can take seconds. The worktree then started from the setting's branch, which can be a different one, so the row named the wrong branch.
The row now never guesses the checkout's branch. It shows, in order:
predictNewWorktreeBaseBranchin@threadlines/shared/git):useNewWorktreeBaseBranchnow returns{ branch, expected, from }.resolveBranchToolbarValuetakes the expected base instead of falling back to the checkout's branch.Tests. New
predictNewWorktreeBaseBranchtests. The slow-branch-list browser test now checks that the row says "From default branch" rather than the checkout's branch. Two existing expectations changed on purpose:resolveBranchToolbarValue's "defaults new-worktree mode to current git ref" test encoded the bug. It now checks the opposite.Web unit (3,305), shared git (43), ChatView browser (312) and source control browser (56) tests pass, along with fmt, lint and typecheck.
Review. Reviewed by GPT-6.2-Astra. Fixed: a missing named branch reappearing after the lookup answered; a failed lookup looking like loading; "the default branch" shown before the setting arrived. Left as before: if the setting changes while a new thread is open, the saved base stays until the new lookup lands (this predates this change). The chip's empty text stays "Select ref".