mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-14 11:02:27 +03:00
Don't return commits from setCommitMergedStatuses
Since the slice stores pointers to objects, and we're only modifying the objects but not the slice itself, there's no need to return it and assign it back. This will allow us to call the function for subslices of commits. Also, move the condition that checks for an empty string inside the function; we're going to call it from more than one place, so this makes it easier.
This commit is contained in:
@ -548,7 +548,8 @@ func TestCommitLoader_setCommitMergedStatuses(t *testing.T) {
|
||||
|
||||
for _, scenario := range scenarios {
|
||||
t.Run(scenario.testName, func(t *testing.T) {
|
||||
expectedCommits := setCommitMergedStatuses(scenario.ancestor, scenario.commits)
|
||||
expectedCommits := scenario.commits
|
||||
setCommitMergedStatuses(scenario.ancestor, expectedCommits)
|
||||
assert.Equal(t, scenario.expectedCommits, expectedCommits)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user