1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-12 11:15:00 +02:00

Fix panic in merge conflict

This commit is contained in:
Ryooooooga 2021-08-21 18:34:30 +09:00
parent 2eeff1257b
commit 0af0e66586
No known key found for this signature in database
GPG Key ID: 07CF200DFCC20C25

View File

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