diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2019-02-20 19:46:27 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-02-20 19:46:27 +1100 |
commit | 9661ea04f368e5b47d9c624101d7a1804012520b (patch) | |
tree | 9150a491709e0b66af3b19479412ef8c3c614892 | |
parent | 0228e250847d042730038281f435b0b21d992c42 (diff) |
wrap amend command in a confirmation
-rw-r--r-- | pkg/gui/commits_panel.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go index a68b71bb1..77b0b54dd 100644 --- a/pkg/gui/commits_panel.go +++ b/pkg/gui/commits_panel.go @@ -270,8 +270,10 @@ func (gui *Gui) handleCommitEdit(g *gocui.Gui, v *gocui.View) error { } func (gui *Gui) handleCommitAmendTo(g *gocui.Gui, v *gocui.View) error { - err := gui.GitCommand.AmendTo(gui.State.Commits[gui.State.Panels.Commits.SelectedLine].Sha) - return gui.handleGenericMergeCommandResult(err) + return gui.createConfirmationPanel(gui.g, v, "Amend Commit", "Are you sure you want to amend this commit with your staged files?", func(*gocui.Gui, *gocui.View) error { + err := gui.GitCommand.AmendTo(gui.State.Commits[gui.State.Panels.Commits.SelectedLine].Sha) + return gui.handleGenericMergeCommandResult(err) + }, nil) } func (gui *Gui) handleCommitPick(g *gocui.Gui, v *gocui.View) error { |