mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-11-26 09:00:57 +02:00
add mixed option to HEAD resetting, remove @{upstream}
This commit is contained in:
parent
f528e12c83
commit
0fe9c15ce8
@ -61,6 +61,19 @@ func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error {
|
||||
return gui.refreshFiles()
|
||||
},
|
||||
},
|
||||
{
|
||||
displayStrings: []string{
|
||||
"mixed reset",
|
||||
red.Sprint("git reset --mixed HEAD"),
|
||||
},
|
||||
onPress: func() error {
|
||||
if err := gui.GitCommand.ResetSoft("HEAD"); err != nil {
|
||||
return gui.createErrorPanel(gui.g, err.Error())
|
||||
}
|
||||
|
||||
return gui.refreshFiles()
|
||||
},
|
||||
},
|
||||
{
|
||||
displayStrings: []string{
|
||||
gui.Tr.SLocalize("hardReset"),
|
||||
@ -74,19 +87,6 @@ func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error {
|
||||
return gui.refreshFiles()
|
||||
},
|
||||
},
|
||||
{
|
||||
displayStrings: []string{
|
||||
gui.Tr.SLocalize("hardResetUpstream"),
|
||||
red.Sprint("git reset --hard @{upstream}"),
|
||||
},
|
||||
onPress: func() error {
|
||||
if err := gui.GitCommand.ResetHard("@{upstream}"); err != nil {
|
||||
return gui.createErrorPanel(gui.g, err.Error())
|
||||
}
|
||||
|
||||
return gui.refreshSidePanels(gui.g)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return gui.createMenu("", menuItems, createMenuOptions{showCancel: true})
|
||||
|
@ -948,6 +948,9 @@ func addEnglish(i18nObject *i18n.Bundle) error {
|
||||
}, &i18n.Message{
|
||||
ID: "resetToThisTag",
|
||||
Other: "reset to this tag",
|
||||
}, &i18n.Message{
|
||||
ID: "resetToUpstream",
|
||||
Other: "reset to the HEAD of the upstream branch",
|
||||
},
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user