1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-12 11:15:00 +02:00
lazygit/pkg/gui/sub_commits_panel.go
Jesse Duffield 1253100431 cleanup
2022-03-17 19:13:40 +11:00

23 lines
486 B
Go

package gui
// list panel functions
func (gui *Gui) subCommitsRenderToMain() error {
commit := gui.State.Contexts.SubCommits.GetSelected()
var task updateTask
if commit == nil {
task = NewRenderStringTask("No commits")
} else {
cmdObj := gui.git.Commit.ShowCmdObj(commit.Sha, gui.State.Modes.Filtering.GetPath())
task = NewRunPtyTask(cmdObj.GetCmd())
}
return gui.refreshMainViews(refreshMainOpts{
main: &viewUpdateOpts{
title: "Commit",
task: task,
},
})
}