1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-20 05:19:24 +02:00

allow resetting to tag

This commit is contained in:
Jesse Duffield 2020-02-16 09:09:48 +11:00
parent 8ca9f93ccf
commit f528e12c83
3 changed files with 20 additions and 0 deletions

View File

@ -577,6 +577,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Handler: gui.handleCreateTag,
Description: gui.Tr.SLocalize("createTag"),
},
{
ViewName: "branches",
Contexts: []string{"tags"},
Key: gui.getKey("commits.viewResetOptions"),
Modifier: gocui.ModNone,
Handler: gui.handleCreateResetToTagMenu,
Description: gui.Tr.SLocalize("resetToThisTag"),
},
{
ViewName: "branches",
Key: gui.getKey("universal.nextTab"),

View File

@ -140,3 +140,12 @@ func (gui *Gui) handleCreateTag(g *gocui.Gui, v *gocui.View) error {
return gui.refreshTags()
})
}
func (gui *Gui) handleCreateResetToTagMenu(g *gocui.Gui, v *gocui.View) error {
tag := gui.getSelectedTag()
if tag == nil {
return nil
}
return gui.createResetMenu(tag.Name)
}

View File

@ -945,6 +945,9 @@ func addEnglish(i18nObject *i18n.Bundle) error {
}, &i18n.Message{
ID: "resetToThisBranch",
Other: "reset to the HEAD of this branch",
}, &i18n.Message{
ID: "resetToThisTag",
Other: "reset to this tag",
},
)
}