diff --git a/pkg/gui/controllers/helpers/branches_helper.go b/pkg/gui/controllers/helpers/branches_helper.go index e87edb460..31f422165 100644 --- a/pkg/gui/controllers/helpers/branches_helper.go +++ b/pkg/gui/controllers/helpers/branches_helper.go @@ -225,6 +225,16 @@ func (self *BranchesHelper) promptWorktreeBranchDelete( }) }, }, + { + Label: self.c.Tr.RemoveWorktreeAndBranch, + Tooltip: self.c.Tr.RemoveWorktreeTooltip, + OnPress: func() error { + if err := self.worktreeHelper.Remove(worktree, false); err != nil { + return err + } + return self.c.Git().Branch.LocalDelete([]string{selectedBranch.Name}, true) + }, + }, }, }) } diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index 9c72b53df..d4dfb06db 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -891,6 +891,7 @@ type TranslationSet struct { DetachWorktreeTooltip string Switching string RemoveWorktree string + RemoveWorktreeAndBranch string RemoveWorktreeTitle string RemoveWorktreeMenuTitle string RemoveWorktreeAndDeleteBranch string @@ -2053,6 +2054,7 @@ func EnglishTranslationSet() *TranslationSet { DetachWorktreeTooltip: "This will run `git checkout --detach` on the worktree so that it stops hogging the branch, but the worktree's working tree will be left alone.", Switching: "Switching", RemoveWorktree: "Remove worktree", + RemoveWorktreeAndBranch: "Remove worktree and branch", RemoveWorktreeTitle: "Remove worktree", RemoveWorktreeMenuTitle: "Remove worktree '{{.worktreeName}}'?", RemoveWorktreeAndDeleteBranch: "Remove worktree and delete branch",