mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-12 16:46:25 -04:00
26 lines
591 B
Go
26 lines
591 B
Go
package gui
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
|
)
|
|
|
|
func (gui *Gui) branchesRenderToMain() error {
|
|
var task types.UpdateTask
|
|
branch := gui.State.Contexts.Branches.GetSelected()
|
|
if branch == nil {
|
|
task = types.NewRenderStringTask(gui.c.Tr.NoBranchesThisRepo)
|
|
} else {
|
|
cmdObj := gui.git.Branch.GetGraphCmdObj(branch.FullRefName())
|
|
|
|
task = types.NewRunPtyTask(cmdObj.GetCmd())
|
|
}
|
|
|
|
return gui.c.RenderToMainViews(types.RefreshMainOpts{
|
|
Pair: gui.c.MainViewPairs().Normal,
|
|
Main: &types.ViewUpdateOpts{
|
|
Title: gui.c.Tr.LogTitle,
|
|
Task: task,
|
|
},
|
|
})
|
|
}
|