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

Call getDisplayStrings with a valid range of model indices

It's nicer if clients can rely on the indices being valid, and don't have to
clamp themselves.
This commit is contained in:
Stefan Haller
2023-08-18 16:50:07 +02:00
parent 473d989cde
commit 297a020abf
3 changed files with 8 additions and 9 deletions

View File

@@ -247,7 +247,7 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}},
},
startIdx: 1,
endIdx: 11,
endIdx: 5,
showGraph: true,
bisectInfo: git_commands.NewNullBisectInfo(),
cherryPickedCommitShaSet: set.New[string](),
@@ -312,7 +312,7 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}},
},
startIdx: 4,
endIdx: 6,
endIdx: 5,
showGraph: true,
bisectInfo: git_commands.NewNullBisectInfo(),
cherryPickedCommitShaSet: set.New[string](),
@@ -351,7 +351,7 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "commit3", Sha: "sha3", Parents: []string{"sha4"}},
},
startIdx: 0,
endIdx: 5,
endIdx: 3,
showGraph: true,
bisectInfo: git_commands.NewNullBisectInfo(),
cherryPickedCommitShaSet: set.New[string](),