mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
use new branch logic when 'checking out' remote branch
This commit is contained in:
committed by
github-actions[bot]
parent
bd8f198beb
commit
f5c55f066b
@ -1426,7 +1426,8 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||||
Key: gui.getKey("universal.select"),
|
Key: gui.getKey("universal.select"),
|
||||||
Handler: gui.handleCheckoutRemoteBranch,
|
// gonna use the exact same handler as the 'n' keybinding because everybody wants this to happen when they checkout a remote branch
|
||||||
|
Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem),
|
||||||
Description: gui.Tr.SLocalize("checkout"),
|
Description: gui.Tr.SLocalize("checkout"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -42,17 +42,6 @@ func (gui *Gui) handleRemoteBranchesEscape(g *gocui.Gui, v *gocui.View) error {
|
|||||||
return gui.switchContext(gui.Contexts.Remotes.Context)
|
return gui.switchContext(gui.Contexts.Remotes.Context)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) handleCheckoutRemoteBranch(g *gocui.Gui, v *gocui.View) error {
|
|
||||||
remoteBranch := gui.getSelectedRemoteBranch()
|
|
||||||
if remoteBranch == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if err := gui.handleCheckoutRef(remoteBranch.FullName(), handleCheckoutRefOptions{}); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return gui.switchContext(gui.Contexts.Branches.Context)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (gui *Gui) handleMergeRemoteBranch(g *gocui.Gui, v *gocui.View) error {
|
func (gui *Gui) handleMergeRemoteBranch(g *gocui.Gui, v *gocui.View) error {
|
||||||
selectedBranchName := gui.getSelectedRemoteBranch().FullName()
|
selectedBranchName := gui.getSelectedRemoteBranch().FullName()
|
||||||
return gui.mergeBranchIntoCheckedOutBranch(selectedBranchName)
|
return gui.mergeBranchIntoCheckedOutBranch(selectedBranchName)
|
||||||
|
Reference in New Issue
Block a user