Skip to content

feat(rm): add branch deletion option#9

Merged
AlecRust merged 1 commit into
AlecRust:mainfrom
asainz:delete-branch-on-rm
Apr 30, 2026
Merged

feat(rm): add branch deletion option#9
AlecRust merged 1 commit into
AlecRust:mainfrom
asainz:delete-branch-on-rm

Conversation

@asainz

@asainz asainz commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Current problem

Removing a managed worktree always leaves its branch behind, forcing users to clean up workbox branches manually when they want the sandbox branch removed with the worktree.

Proposed solution

Add an explicit --delete-branch flag to rm. Keep the default behavior of preserving branches, delete only managed branches after successful worktree removal, and map --force to force branch deletion. Cover the default, managed deletion, and unmanaged refusal paths with tests.

# Current problem

Removing a managed worktree always leaves its branch behind, forcing users to clean up workbox branches manually when they want the sandbox branch removed with the worktree.

# Proposed solution

Add an explicit --delete-branch flag to rm. Keep the default behavior of preserving branches, delete only managed branches after successful worktree removal, and map --force to force branch deletion. Cover the default, managed deletion, and unmanaged refusal paths with tests.
@AlecRust

Copy link
Copy Markdown
Owner

Thanks lgtm!

@AlecRust AlecRust merged commit 0021dce into AlecRust:main Apr 30, 2026
3 checks passed
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.

2 participants