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:
commit
508af269fb
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user