1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-29 22:48:24 +02:00
This commit is contained in:
Jesse Duffield
2020-08-18 22:02:35 +10:00
parent 3c87ff4eff
commit f5b22d94d9
14 changed files with 259 additions and 152 deletions

View File

@@ -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