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