1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-09 01:17:06 +02:00

Use ConfirmIf where applicable

This commit is contained in:
Stefan Haller
2025-07-06 14:25:13 +02:00
parent c35f907f9f
commit 2c3b25ae62
11 changed files with 143 additions and 234 deletions

View File

@ -724,17 +724,11 @@ func (self *BranchesController) rename(branch *models.Branch) error {
// I could do an explicit check here for whether the branch is tracking a remote branch
// but if we've selected it we'll already know that via Pullables and Pullables.
// Bit of a hack but I'm lazy.
if !branch.IsTrackingRemote() {
return promptForNewName()
}
self.c.Confirm(types.ConfirmOpts{
return self.c.ConfirmIf(branch.IsTrackingRemote(), types.ConfirmOpts{
Title: self.c.Tr.RenameBranch,
Prompt: self.c.Tr.RenameBranchWarning,
HandleConfirm: promptForNewName,
})
return nil
}
func (self *BranchesController) newBranch(selectedBranch *models.Branch) error {