diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-10-20 22:21:16 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-10-22 21:33:17 +1100 |
commit | 6388af70acda91bf1bdc9cba9f38dc810f49f9ca (patch) | |
tree | 1901eb73ccf719c04b99b933a0cc2182e6dd3a0c /pkg/gui/rebase_options_panel.go | |
parent | 5ee559b89660cb850040ce41fee242514a09ba8b (diff) |
simplify pull logic
Diffstat (limited to 'pkg/gui/rebase_options_panel.go')
-rw-r--r-- | pkg/gui/rebase_options_panel.go | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/pkg/gui/rebase_options_panel.go b/pkg/gui/rebase_options_panel.go index a50608b67..d554bc746 100644 --- a/pkg/gui/rebase_options_panel.go +++ b/pkg/gui/rebase_options_panel.go @@ -63,6 +63,23 @@ func (gui *Gui) genericMergeCommand(command string) error { return nil } +var conflictStrings = []string{ + "Failed to merge in the changes", + "When you have resolved this problem", + "fix conflicts", + "Resolve all conflicts manually", +} + +func isMergeConflictErr(errStr string) bool { + for _, str := range conflictStrings { + if strings.Contains(errStr, str) { + return true + } + } + + return false +} + func (gui *Gui) handleGenericMergeCommandResult(result error) error { if err := gui.refreshSidePanels(refreshOptions{mode: ASYNC}); err != nil { return err @@ -76,7 +93,7 @@ func (gui *Gui) handleGenericMergeCommandResult(result error) error { } else if strings.Contains(result.Error(), "No rebase in progress?") { // assume in this case that we're already done return nil - } else if strings.Contains(result.Error(), "When you have resolved this problem") || strings.Contains(result.Error(), "fix conflicts") || strings.Contains(result.Error(), "Resolve all conflicts manually") { + } else if isMergeConflictErr(result.Error()) { return gui.ask(askOpts{ title: gui.Tr.FoundConflictsTitle, prompt: gui.Tr.FoundConflicts, |