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

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

func (gui *Gui) tagsRenderToMain() error {
	var task types.UpdateTask
	tag := gui.State.Contexts.Tags.GetSelected()
	if tag == nil {
		task = types.NewRenderStringTask("No tags")
	} else {
		cmdObj := gui.git.Branch.GetGraphCmdObj(tag.FullRefName())
		task = types.NewRunCommandTask(cmdObj.GetCmd())
	}

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