Repository navigation
Delete a merged branch together with its remote branch - #70
Merged
Merged
Conversation
Cleaning up after a merged PR took a delete in the local list and another in the remote list. A merged local branch whose upstream still exists, holds nothing the branch lacks and isn't a shared integration branch now offers "Delete both". The worktree card's "Remove + branch" gets the same reach. When the remote branch can go too, it reads "Remove + branch + origin", and the dialog has a ticked "Also delete origin/..." box to keep it instead. The action is gone from the table's worktree sub-row: deleting a branch is a call to make with the card open, not from a hover lane. Both remote deletes are leased on the tip last fetched, so a branch someone pushed to since is refused rather than deleted. The remote goes first, leaving the local branch to retry from if the remote refuses. The table's name column now takes 30% of the table width (262-560dp) instead of a fixed 262dp, so long claude/... worktree branch names fit on a wide window. The sub-row's badges also line up with the repo row's now; they sat 16dp to the left before. Signed-off-by: Raman Gupta <rocketraman@gmail.com>
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.
Cleaning up after a merged PR took one delete in the local branch list and another in the remote list. This does both in one step, from the branch list and from a worktree.
What changed
Branch list. A merged local branch shows Delete both when its upstream:
Like the existing deletes of merged branches, there's no confirmation.
Worktree card. When the remote branch can go too, "Remove + branch" reads Remove + branch + origin. The confirm dialog has a ticked Also delete "origin/…" on origin box, and the button reads "Remove all" or "Remove both" depending on it. The box is in the dialog rather than a separate button because this is the part that reaches the server.
Worktree sub-row (table). "Remove + branch" is gone from the hover actions, which are now Diff, Log and Terminal. Deleting a branch should happen from the card, where you can see the branch, not from actions that appear when the pointer passes over the row.
Table layout. The name column takes 30% of the table width, between 262dp and 560dp, instead of a fixed 262dp. Long
claude/…worktree branch names now fit on a wide window. The sub-rows' badge column now lines up with the repo row's; it was 16dp to the left before.For reviewers
--force-with-lease=refs/heads/<b>:<last-fetched sha>). If someone pushed to the branch since the last fetch, the remote refuses instead of discarding their commits. The shared helper isBranchOps.deleteUpstreamLeased.Worktree.deletableUpstreamis computed on the scan path, but only for merged worktrees: one extrafor-each-refeach.Popup.ConfirmWithOptionis a new popup (one checkbox), so the 15 existingPopup.Confirmcall sites are unchanged.Testing
BranchOpsTestandWorktreeOpsTest: