summaryrefslogtreecommitdiffstats
path: root/pkg/gui
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-02-16 09:21:23 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-02-16 09:57:49 +1100
commitfeaf98bd018502ca95c0d93be0d8b2bfa7f46f03 (patch)
tree593097c7b1a35512af33c30676fefae8e8d3559e /pkg/gui
parent0fe9c15ce8566b28516df626b3df0e4bc62e840a (diff)
add reset to upstream option on files panel
Diffstat (limited to 'pkg/gui')
-rw-r--r--pkg/gui/files_panel.go4
-rw-r--r--pkg/gui/keybindings.go7
2 files changed, 11 insertions, 0 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go
index df6481f50..1ca3538a2 100644
--- a/pkg/gui/files_panel.go
+++ b/pkg/gui/files_panel.go
@@ -570,3 +570,7 @@ func (gui *Gui) handleCreateStashMenu(g *gocui.Gui, v *gocui.View) error {
func (gui *Gui) handleStashChanges(g *gocui.Gui, v *gocui.View) error {
return gui.handleStashSave(gui.GitCommand.StashSave)
}
+
+func (gui *Gui) handleCreateResetToUpstreamMenu(g *gocui.Gui, v *gocui.View) error {
+ return gui.createResetMenu("@{upstream}")
+}
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index 9f8263ba7..2df06fd86 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -458,6 +458,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Description: gui.Tr.SLocalize("executeCustomCommand"),
},
{
+ ViewName: "files",
+ Key: gui.getKey("commits.viewResetOptions"),
+ Modifier: gocui.ModNone,
+ Handler: gui.handleCreateResetToUpstreamMenu,
+ Description: gui.Tr.SLocalize("resetToUpstream"),
+ },
+ {
ViewName: "branches",
Contexts: []string{"local-branches"},
Key: gui.getKey("universal.select"),