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

23 lines
486 B
Go
Raw Normal View History

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