diff options
author | Harrison Jones <harrison@hhj.me> | 2021-05-20 12:51:26 -0400 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-05-30 13:50:42 +1000 |
commit | e478c254d43495ecfa2dad55df1ca2d2726ff974 (patch) | |
tree | a5cadd2fa543dd5b4f94474bbbeff14e998139c5 /pkg/gui/mergeconflicts/state.go | |
parent | 44f7fc6f7c03a8eeb18e22f3605a384516b31baa (diff) |
Handle alternate merge conflict format; add tests
Diffstat (limited to 'pkg/gui/mergeconflicts/state.go')
-rw-r--r-- | pkg/gui/mergeconflicts/state.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/gui/mergeconflicts/state.go b/pkg/gui/mergeconflicts/state.go index 17ac02a0b..383d71a36 100644 --- a/pkg/gui/mergeconflicts/state.go +++ b/pkg/gui/mergeconflicts/state.go @@ -104,6 +104,10 @@ func findConflicts(content string) []*mergeConflict { case "=======": newConflict.middle = i default: + // Sometimes these lines look like "<<<<<<< HEAD:foo/bar/baz.go" so handle that case as well. + if strings.HasPrefix(trimmedLine, "<<<<<<< HEAD:") { + newConflict = &mergeConflict{start: i} + } if strings.HasPrefix(trimmedLine, ">>>>>>> ") { newConflict.end = i conflicts = append(conflicts, newConflict) |