1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Fix crash when viewing the divergence of a branch which is up to date with its upstream

This was introduced by #3838, specifically by commit e675025411.

Add a regression test that would have crashed without the fix.
This commit is contained in:
Stefan Haller
2024-09-16 20:50:31 +02:00
parent 4dadcd2ace
commit f8073c7188
3 changed files with 39 additions and 1 deletions

View File

@ -121,7 +121,10 @@ func (self *ListRenderer) insertNonModelItems(
break
}
if item.Index+offset >= startIdx {
padding := strings.Repeat(" ", columnPositions[item.Column])
padding := ""
if columnPositions != nil {
padding = strings.Repeat(" ", columnPositions[item.Column])
}
lines = slices.Insert(lines, item.Index+offset-startIdx, padding+item.Content)
}
offset++