2020-08-22 00:49:02 +02:00
|
|
|
package gui
|
|
|
|
|
|
|
|
// list panel functions
|
|
|
|
|
2021-11-21 03:48:49 +02:00
|
|
|
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 {
|
2022-01-16 05:46:53 +02:00
|
|
|
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,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|