diff --git a/pkg/gui/controllers/helpers/branches_helper.go b/pkg/gui/controllers/helpers/branches_helper.go index 9748fecc5..90c65c009 100644 --- a/pkg/gui/controllers/helpers/branches_helper.go +++ b/pkg/gui/controllers/helpers/branches_helper.go @@ -240,6 +240,16 @@ func (self *BranchesHelper) promptWorktreeBranchDelete(selectedBranch *models.Br return self.worktreeHelper.Remove(worktree, false) }, }, + { + 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 002adb114..5f38c2427 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -866,6 +866,7 @@ type TranslationSet struct { DetachWorktreeTooltip string Switching string RemoveWorktree string + RemoveWorktreeAndBranch string RemoveWorktreeTitle string DetachWorktree string DetachingWorktree string @@ -1990,6 +1991,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", RemoveWorktreePrompt: "Are you sure you want to remove worktree '{{.worktreeName}}'?", ForceRemoveWorktreePrompt: "'{{.worktreeName}}' contains modified or untracked files, or submodules (or all of these). Are you sure you want to remove it?",