summaryrefslogtreecommitdiffstats
path: root/pkg/gui/merge_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-12-05 22:30:10 +1100
committerJesse Duffield <jessedduffield@gmail.com>2018-12-11 09:39:54 +1100
commite0ff46fe53503d74fc63c90fc5ddc4d9468b60d5 (patch)
tree137f8360a1416b08cc6c327ba47b07a4670366d6 /pkg/gui/merge_panel.go
parentcce6f405a5643ed46a6bc0b9fd7cf132c915c9f3 (diff)
more work on rebasing including visual indicators
Diffstat (limited to 'pkg/gui/merge_panel.go')
-rw-r--r--pkg/gui/merge_panel.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/pkg/gui/merge_panel.go b/pkg/gui/merge_panel.go
index 7c2922c9b..404266d29 100644
--- a/pkg/gui/merge_panel.go
+++ b/pkg/gui/merge_panel.go
@@ -20,11 +20,12 @@ func (gui *Gui) findConflicts(content string) ([]commands.Conflict, error) {
conflicts := make([]commands.Conflict, 0)
var newConflict commands.Conflict
for i, line := range utils.SplitLines(content) {
- if line == "<<<<<<< HEAD" || line == "<<<<<<< MERGE_HEAD" || line == "<<<<<<< Updated upstream" {
+ trimmedLine := strings.TrimPrefix(line, "++")
+ if trimmedLine == "<<<<<<< HEAD" || trimmedLine == "<<<<<<< MERGE_HEAD" || trimmedLine == "<<<<<<< Updated upstream" {
newConflict = commands.Conflict{Start: i}
- } else if line == "=======" {
+ } else if trimmedLine == "=======" {
newConflict.Middle = i
- } else if strings.HasPrefix(line, ">>>>>>> ") {
+ } else if strings.HasPrefix(trimmedLine, ">>>>>>> ") {
newConflict.End = i
conflicts = append(conflicts, newConflict)
}
@@ -258,10 +259,16 @@ func (gui *Gui) handleCompleteMerge(g *gocui.Gui) error {
gui.refreshFiles(g)
if rebase, err := gui.GitCommand.IsInRebaseState(); rebase && err == nil {
if err := gui.GitCommand.ContinueRebaseBranch(); err != nil {
- gui.Log.Errorln(err)
+ if strings.Contains(err.Error(), "No changes - did you forget to use") {
+ if err := gui.GitCommand.SkipRebaseBranch(); err != nil {
+ gui.Log.Errorln(err)
+ }
+ } else {
+ gui.Log.Errorln(err)
+ }
}
if err := gui.refreshSidePanels(g); err != nil {
- gui.Log.Errorln(err)
+ return err
}
}
return gui.switchFocus(g, nil, filesView)