mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-10 22:42:00 +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:
@@ -30,10 +30,14 @@ func findConflicts(content string) []*mergeConflict {
|
|||||||
case START:
|
case START:
|
||||||
newConflict = &mergeConflict{start: i}
|
newConflict = &mergeConflict{start: i}
|
||||||
case MIDDLE:
|
case MIDDLE:
|
||||||
|
if newConflict != nil {
|
||||||
newConflict.middle = i
|
newConflict.middle = i
|
||||||
|
}
|
||||||
case END:
|
case END:
|
||||||
|
if newConflict != nil {
|
||||||
newConflict.end = i
|
newConflict.end = i
|
||||||
conflicts = append(conflicts, newConflict)
|
conflicts = append(conflicts, newConflict)
|
||||||
|
}
|
||||||
// reset value to avoid any possible silent mutations in further iterations
|
// reset value to avoid any possible silent mutations in further iterations
|
||||||
newConflict = nil
|
newConflict = nil
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user