1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-12 04:23:03 +02:00

Merge pull request #1446 from Ryooooooga/feature/fix-panic-in-merge-conflict

Fix panic during merge conflict #1375
This commit is contained in:
Mark Kopenga 2021-08-21 18:07:21 +02:00 committed by GitHub
commit 508af269fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,10 +30,14 @@ func findConflicts(content string) []*mergeConflict {
case START:
newConflict = &mergeConflict{start: i}
case MIDDLE:
newConflict.middle = i
if newConflict != nil {
newConflict.middle = i
}
case END:
newConflict.end = i
conflicts = append(conflicts, newConflict)
if newConflict != nil {
newConflict.end = i
conflicts = append(conflicts, newConflict)
}
// reset value to avoid any possible silent mutations in further iterations
newConflict = nil
default: