fix(worktree): include local branches in base ref options#222
fix(worktree): include local branches in base ref options#222onevclaw wants to merge 1 commit intosupabitapp:mainfrom
Conversation
|
Thanks for reviewing this. After discussing this in our downstream repo, we realized this might not be an accidental miss, but an intentional design choice in upstream history:
So I think the current behavior is likely a product decision (canonicalizing tracking branches to upstream refs), not just an implementation bug. My motivation for this PR is the local/remote divergence case: when local tip and Question for maintainers: would you prefer to keep the current canonical upstream-only behavior, or accept exposing both local + upstream refs (with dedup/sort) so users can choose explicitly when they diverge? I am happy to adjust the implementation (or close this PR) based on your preferred product semantics. |
|
Hey 👋 I can’t speak for @khoi, but I think there’s definitely value in presenting a more complete list of branches. I’d probably separate them from the main list, though. Something like
|
|
I think including the local branches make sense, I removed it because the list get too long with a lot of duplicated branches on both remote/local. I don't have an UI solution to solve this, I trust @sbertix on coming up with a decent UX for this. but I'm +1 for showing the comprehensive list |

Summary
Why this matters
When a local branch tracks
origin/*,branchRefs(for:)currently returns only the upstream ref and drops the local one. This makes the base-ref picker look remote-only in cases where local and origin refs diverge.Change
parseLocalRefsWithUpstreamnow emits both refs (local + upstream when present), then existing filtering/sorting/deduplication continues to apply.Validation
GitClientBranchRefsTeststo verify local + upstream refs are both returnedThis is a contribution from downstream fork fix: onevcat#167.