summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/branches_controller.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/controllers/branches_controller.go')
-rw-r--r--pkg/gui/controllers/branches_controller.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/pkg/gui/controllers/branches_controller.go b/pkg/gui/controllers/branches_controller.go
index d5564ec95..27b3004c8 100644
--- a/pkg/gui/controllers/branches_controller.go
+++ b/pkg/gui/controllers/branches_controller.go
@@ -111,6 +111,30 @@ func (self *BranchesController) GetKeybindings(opts types.KeybindingsOpts) []*ty
}
}
+func (self *BranchesController) GetOnRenderToMain() func() error {
+ return func() error {
+ return self.helpers.Diff.WithDiffModeCheck(func() error {
+ var task types.UpdateTask
+ branch := self.context().GetSelected()
+ if branch == nil {
+ task = types.NewRenderStringTask(self.c.Tr.NoBranchesThisRepo)
+ } else {
+ cmdObj := self.c.Git().Branch.GetGraphCmdObj(branch.FullRefName())
+
+ task = types.NewRunPtyTask(cmdObj.GetCmd())
+ }
+
+ return self.c.RenderToMainViews(types.RefreshMainOpts{
+ Pair: self.c.MainViewPairs().Normal,
+ Main: &types.ViewUpdateOpts{
+ Title: self.c.Tr.LogTitle,
+ Task: task,
+ },
+ })
+ })
+ }
+}
+
func (self *BranchesController) setUpstream(selectedBranch *models.Branch) error {
return self.c.Menu(types.CreateMenuOptions{
Title: self.c.Tr.Actions.SetUnsetUpstream,