Skip to content

fix(git): keep worktree origin base without inheriting master upstream - #576

Merged
SDSLeon merged 2 commits into
masterfrom
poracode/clever-falcon-2541f8a0
Aug 17, 2026
Merged

fix(git): keep worktree origin base without inheriting master upstream#576
SDSLeon merged 2 commits into
masterfrom
poracode/clever-falcon-2541f8a0

Conversation

@SDSLeon

@SDSLeon SDSLeon commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • New worktrees now default to the origin/tracking ref (T3-style). Picking master in the dropdown stays on origin/master. Worktree + changes and Branch stay on the local checkout.
  • Creating a worktree from origin/master no longer sets that ref as the new branch's git upstream. Git's default autoSetupMerge was making poracode/… track origin/master, which showed a false "behind" badge and broke git push (upstream branch does not match).
  • Existing worktrees that already inherited the fork base as upstream are repaired on the next git status (branch --unset-upstream).

Test plan

  • pnpm exec vitest run on BranchSelector, ThreadDraftView, git.test, and status parser tests
  • Switch a draft to Worktree: trigger shows origin/<branch>; selecting the local name keeps origin
  • Switch to Worktree + changes: trigger stays on the local branch and still offers to copy uncommitted files
  • Create a new worktree from origin/master: git status -sb is poracode/… with no ...origin/master
  • git push -u origin HEAD publishes origin/poracode/… without the name-mismatch error

- Resolve worktree base refs consistently in branch selection and composer
- Disable inherited upstream tracking when creating worktrees
- Clear stale inherited upstreams during status parsing
- Expand branch, composer, and Git regression coverage
@SDSLeon
SDSLeon merged commit 464900d into master Aug 17, 2026
8 checks passed
@SDSLeon
SDSLeon deleted the poracode/clever-falcon-2541f8a0 branch August 17, 2026 03:58
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