Make Commit.Parents a getter for an unexported parents field

This is exactly the same as what we did for Hash earlier. And for the same
reason: we want to turn the parents field into a slice of pointers.
This commit is contained in:
Stefan Haller 2025-04-26 19:58:03 +02:00
parent e27bc15bbd
commit 0f1f455edb
4 changed files with 13 additions and 9 deletions

View file

@ -576,7 +576,7 @@ func generateCommits(count int) []*models.Commit {
// I need to pick a random number of parents to add
parentCount := rnd.Intn(2) + 1
parentHashes := currentCommit.Parents
parentHashes := currentCommit.Parents()
for j := 0; j < parentCount; j++ {
reuseParent := rnd.Intn(6) != 1 && j <= len(pool)-1 && j != 0
var newParent *models.Commit