From feaf98bd018502ca95c0d93be0d8b2bfa7f46f03 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 16 Feb 2020 09:21:23 +1100 Subject: [PATCH] add reset to upstream option on files panel --- pkg/gui/files_panel.go | 4 ++++ pkg/gui/keybindings.go | 7 +++++++ 2 files changed, 11 insertions(+) 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 @@ -457,6 +457,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Handler: gui.handleCustomCommand, 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"},