1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-04 10:34:55 +02:00
lazygit/pkg/gui/remote_branches_panel.go
2022-08-07 12:05:51 +10:00

23 lines
619 B
Go

package gui
import "github.com/jesseduffield/lazygit/pkg/gui/types"
func (gui *Gui) remoteBranchesRenderToMain() error {
var task types.UpdateTask
remoteBranch := gui.State.Contexts.RemoteBranches.GetSelected()
if remoteBranch == nil {
task = types.NewRenderStringTask("No branches for this remote")
} else {
cmdObj := gui.git.Branch.GetGraphCmdObj(remoteBranch.FullRefName())
task = types.NewRunCommandTask(cmdObj.GetCmd())
}
return gui.c.RenderToMainViews(types.RefreshMainOpts{
Pair: gui.c.MainViewPairs().Normal,
Main: &types.ViewUpdateOpts{
Title: "Remote Branch",
Task: task,
},
})
}