diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-12-11 22:16:48 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-12-11 22:16:48 +1100 |
commit | a3656154906c1117f9c9bbe100aa585e43417897 (patch) | |
tree | 6247c687bde83aa32ccb79fb6e341189fb2116af /pkg | |
parent | 9489a9447396b30bca86ea3df201cacfdffdb1a9 (diff) |
only use subprocess for merging, not rebasing
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/gui/branches_panel.go | 5 | ||||
-rw-r--r-- | pkg/gui/rebase_options_panel.go | 14 |
2 files changed, 13 insertions, 6 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index 82a850e9d..b94c91e28 100644 --- a/pkg/gui/branches_panel.go +++ b/pkg/gui/branches_panel.go @@ -112,9 +112,12 @@ func (gui *Gui) handleRebase(g *gocui.Gui, v *gocui.View) error { } if err := gui.GitCommand.RebaseBranch(selectedBranch); err != nil { + if err := gui.refreshSidePanels(g); err != nil { + return err + } return gui.createConfirmationPanel(g, v, "Auto-rebase failed", gui.Tr.SLocalize("FoundConflicts"), func(g *gocui.Gui, v *gocui.View) error { - return nil + return gui.refreshSidePanels(g) }, func(g *gocui.Gui, v *gocui.View) error { if err := gui.GitCommand.AbortRebaseBranch(); err != nil { return err diff --git a/pkg/gui/rebase_options_panel.go b/pkg/gui/rebase_options_panel.go index 1752af496..c189bb4c4 100644 --- a/pkg/gui/rebase_options_panel.go +++ b/pkg/gui/rebase_options_panel.go @@ -51,11 +51,15 @@ func (gui *Gui) genericRebaseCommand(command string) error { commandType := strings.Replace(status, "ing", "e", 1) // we should end up with a command like 'git merge --continue' - sub := gui.OSCommand.PrepareSubProcess("git", commandType, fmt.Sprintf("--%s", command)) - if sub != nil { - gui.SubProcess = sub - return gui.Errors.ErrSubProcess + // it's impossible for a rebase to require a commit so we'll use a subprocess only if it's a merge + if status == "merging" { + sub := gui.OSCommand.PrepareSubProcess("git", commandType, fmt.Sprintf("--%s", command)) + if sub != nil { + gui.SubProcess = sub + return gui.Errors.ErrSubProcess + } + return nil } - return nil + return gui.OSCommand.RunCommand(fmt.Sprintf("git %s --%s", commandType, command)) } |