summaryrefslogtreecommitdiffstats
path: root/pkg/gui/reflog_panel.go
blob: cb84177da18311ed54c3b155178cb31d89524c5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package gui

import "github.com/jesseduffield/lazygit/pkg/gui/types"

func (gui *Gui) reflogCommitsRenderToMain() error {
	commit := gui.State.Contexts.ReflogCommits.GetSelected()
	var task types.UpdateTask
	if commit == nil {
		task = types.NewRenderStringTask("No reflog history")
	} else {
		cmdObj := gui.git.Commit.ShowCmdObj(commit.Sha, gui.State.Modes.Filtering.GetPath())

		task = types.NewRunPtyTask(cmdObj.GetCmd())
	}

	return gui.c.RenderToMainViews(types.RefreshMainOpts{
		Pair: gui.c.MainViewPairs().Normal,
		Main: &types.ViewUpdateOpts{
			Title: "Reflog Entry",
			Task:  task,
		},
	})
}