1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-10-17 20:31:19 +03:00

Add config option gui.skipSwitchWorktreeOnCheckoutWarning

This commit is contained in:
Stefan Haller
2025-10-14 14:03:58 +02:00
parent d3fb22a673
commit 80f860beb7
4 changed files with 39 additions and 29 deletions

View File

@@ -420,15 +420,13 @@ func (self *BranchesController) promptToCheckoutWorktree(worktree *models.Worktr
"worktreeName": worktree.Name,
})
self.c.Confirm(types.ConfirmOpts{
return self.c.ConfirmIf(!self.c.UserConfig().Gui.SkipSwitchWorktreeOnCheckoutWarning, types.ConfirmOpts{
Title: self.c.Tr.SwitchToWorktree,
Prompt: prompt,
HandleConfirm: func() error {
return self.c.Helpers().Worktree.Switch(worktree, context.LOCAL_BRANCHES_CONTEXT_KEY)
},
})
return nil
}
func (self *BranchesController) handleCreatePullRequest(selectedBranch *models.Branch) error {