1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-25 00:46:54 +02:00

get selected branch from correct panel

This commit is contained in:
Dawid Dziurla
2018-09-03 18:45:52 +02:00
parent bf8514f5e2
commit 67d99a24ea
2 changed files with 8 additions and 2 deletions

View File

@ -10,11 +10,11 @@ import (
)
func (gui *Gui) handleBranchPress(g *gocui.Gui, v *gocui.View) error {
index := gui.getItemPosition(v)
index := gui.getItemPosition(gui.getBranchesView(g))
if index == 0 {
return gui.createErrorPanel(g, gui.Tr.SLocalize("AlreadyCheckedOutBranch"))
}
branch := gui.getSelectedBranch(v)
branch := gui.getSelectedBranch(gui.getBranchesView(g))
if err := gui.GitCommand.Checkout(branch.Name, false); err != nil {
gui.createErrorPanel(g, err.Error())
}