1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-22 05:29:44 +02:00
lazygit/pkg/gui/sub_commits_panel.go

23 lines
486 B
Go
Raw Normal View History

2020-08-22 08:49:02 +10:00
package gui
// list panel functions
func (gui *Gui) subCommitsRenderToMain() error {
2022-02-05 17:04:10 +11:00
commit := gui.State.Contexts.SubCommits.GetSelected()
2020-08-22 08:49:02 +10:00
var task updateTask
if commit == nil {
2021-04-04 23:51:59 +10:00
task = NewRenderStringTask("No commits")
2020-08-22 08:49:02 +10:00
} else {
cmdObj := gui.git.Commit.ShowCmdObj(commit.Sha, gui.State.Modes.Filtering.GetPath())
2020-08-22 08:49:02 +10:00
2021-12-07 21:59:36 +11:00
task = NewRunPtyTask(cmdObj.GetCmd())
2020-08-22 08:49:02 +10:00
}
2020-08-23 09:46:28 +10:00
return gui.refreshMainViews(refreshMainOpts{
2020-08-22 08:49:02 +10:00
main: &viewUpdateOpts{
title: "Commit",
task: task,
},
})
}