mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-17 01:42:45 +02:00
add mixed option to HEAD resetting, remove @{upstream}
This commit is contained in:
@ -61,6 +61,19 @@ func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error {
|
|||||||
return gui.refreshFiles()
|
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{
|
displayStrings: []string{
|
||||||
gui.Tr.SLocalize("hardReset"),
|
gui.Tr.SLocalize("hardReset"),
|
||||||
@ -74,19 +87,6 @@ func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error {
|
|||||||
return gui.refreshFiles()
|
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})
|
return gui.createMenu("", menuItems, createMenuOptions{showCancel: true})
|
||||||
|
@ -948,6 +948,9 @@ func addEnglish(i18nObject *i18n.Bundle) error {
|
|||||||
}, &i18n.Message{
|
}, &i18n.Message{
|
||||||
ID: "resetToThisTag",
|
ID: "resetToThisTag",
|
||||||
Other: "reset to this tag",
|
Other: "reset to this tag",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "resetToUpstream",
|
||||||
|
Other: "reset to the HEAD of the upstream branch",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user