diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-18 22:02:35 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | f5b22d94d939b0fc1aff433686e891e0a7507950 (patch) | |
tree | 9812c4c7f3855d7e3fe973dacf5533ef04463c3d /pkg/gui/branches_panel.go | |
parent | 3c87ff4eff46449d5e697e954b3bdf01d2c76f19 (diff) |
WIP
Diffstat (limited to 'pkg/gui/branches_panel.go')
-rw-r--r-- | pkg/gui/branches_panel.go | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index b856b4007..926c589f0 100644 --- a/pkg/gui/branches_panel.go +++ b/pkg/gui/branches_panel.go @@ -34,28 +34,24 @@ func (gui *Gui) handleBranchSelect() error { return gui.renderDiff() } - refreshOpts := refreshMainOpts{ - main: &viewUpdateOpts{ - title: "Log", - task: { - kind: RENDER_STRING, - str: gui.Tr.SLocalize("NoBranchesThisRepo"), - }, - }, - } - + var task updateTask branch := gui.getSelectedBranch() if branch == nil { - refreshOpts.main.task = func() error { return gui.newStringTask("main", gui.Tr.SLocalize("NoBranchesThisRepo")) } + task = gui.createRenderStringTask(gui.Tr.SLocalize("NoBranchesThisRepo")) } else { cmd := gui.OSCommand.ExecutableFromString( gui.GitCommand.GetBranchGraphCmdStr(branch.Name), ) - refreshOpts.main.task = func() error { return gui.newPtyTask("main", cmd) } + task = gui.createRunPtyTask(cmd) } - return gui.refreshMain(refreshOpts) + return gui.refreshMain(refreshMainOpts{ + main: &viewUpdateOpts{ + title: "Log", + task: task, + }, + }) } // gui.refreshStatus is called at the end of this because that's when we can |