1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-10 04:07:18 +02:00
lazygit/pkg/gui/branches_panel.go
2022-08-06 13:49:11 +10:00

22 lines
495 B
Go

package gui
func (gui *Gui) branchesRenderToMain() error {
var task updateTask
branch := gui.State.Contexts.Branches.GetSelected()
if branch == nil {
task = NewRenderStringTask(gui.c.Tr.NoBranchesThisRepo)
} else {
cmdObj := gui.git.Branch.GetGraphCmdObj(branch.FullRefName())
task = NewRunPtyTask(cmdObj.GetCmd())
}
return gui.refreshMainViews(refreshMainOpts{
pair: gui.normalMainContextPair(),
main: &viewUpdateOpts{
title: gui.c.Tr.LogTitle,
task: task,
},
})
}