Skip to content

Commit 914c24b

Browse files
fix: use selectionTarget.checkoutCwd for post-checkout status query
The git status call after checkout was still using branchCwd instead of selectionTarget.checkoutCwd, causing incorrect branch detection when switching from a secondary worktree to the default branch. Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
1 parent 0f7c6fb commit 914c24b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/web/src/components/BranchToolbarBranchSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export function BranchToolbarBranchSelector({
213213

214214
let nextBranchName = selectedBranchName;
215215
if (branch.isRemote) {
216-
const status = await api.git.status({ cwd: branchCwd }).catch(() => null);
216+
const status = await api.git.status({ cwd: selectionTarget.checkoutCwd }).catch(() => null);
217217
if (status?.branch) {
218218
nextBranchName = status.branch;
219219
}

0 commit comments

Comments
 (0)