summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_commands/commit_loader_test.go
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-08-21 16:31:20 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-08-29 08:16:40 +0200
commit911aa7774b6e0210a0955d7a493d2da82ada54ad (patch)
treef473bf6140913bde40ff12d26a4ce8298c5e6d16 /pkg/commands/git_commands/commit_loader_test.go
parent1fb0e1e151b87a33eb54723fcff19c5828007d42 (diff)
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.
Diffstat (limited to 'pkg/commands/git_commands/commit_loader_test.go')
-rw-r--r--pkg/commands/git_commands/commit_loader_test.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/commands/git_commands/commit_loader_test.go b/pkg/commands/git_commands/commit_loader_test.go
index 8cf9b95a2..4ae7af94a 100644
--- a/pkg/commands/git_commands/commit_loader_test.go
+++ b/pkg/commands/git_commands/commit_loader_test.go
@@ -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)
})
}