mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
When checking out a remote branch by name, ask the user how
The choices are to create a new local branch that tracks the remote, or a detached head.
This commit is contained in:
@ -436,6 +436,10 @@ func (self *BranchesController) checkoutByName() error {
|
||||
FindSuggestionsFunc: self.c.Helpers().Suggestions.GetRefsSuggestionsFunc(),
|
||||
HandleConfirm: func(response string) error {
|
||||
self.c.LogAction("Checkout branch")
|
||||
_, branchName, found := self.c.Helpers().Refs.ParseRemoteBranchName(response)
|
||||
if found {
|
||||
return self.c.Helpers().Refs.CheckoutRemoteBranch(response, branchName)
|
||||
}
|
||||
return self.c.Helpers().Refs.CheckoutRef(response, types.CheckoutRefOptions{
|
||||
OnRefNotFound: func(ref string) error {
|
||||
return self.c.Confirm(types.ConfirmOpts{
|
||||
|
Reference in New Issue
Block a user