Skip to content

fix: resolve worktree base branch from current HEAD, not default_branch - #32

Merged
HenryLach merged 1 commit into
mainfrom
fix/workspace-base-branch-resolution
Mar 16, 2026
Merged

HenryLach merged 1 commit into
mainfrom
fix/workspace-base-branch-resolution

Conversation

@HenryLach

Copy link
Copy Markdown
Owner

resolveBaseBranch() was prioritizing the workspace config's default_branch over the repo's actual current branch. This caused worktrees to branch from develop instead of the developer's feature branch, so task files committed on the feature branch were missing from worktrees.

Root cause

Priority order was: default_branch → current branch → batch base branch. Should be: current branch → default_branch → batch base branch.

Fix

Swap steps 1 and 2 in resolveBaseBranch() so the repo's current HEAD is detected first.

Testing

398/398 tests passing.

resolveBaseBranch() was prioritizing the workspace config's default_branch
over the repo's actual current branch. This caused worktrees to be created
from 'develop' instead of the developer's feature branch, missing any
commits made on the feature branch (including task files).

Swap priority: detect current branch first, fall back to default_branch
only when HEAD is detached or undetectable.
@HenryLach
HenryLach merged commit 28a0263 into main Mar 16, 2026
1 check passed
@HenryLach
HenryLach deleted the fix/workspace-base-branch-resolution branch March 16, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant