Skip to content

Commit

Permalink
Fix calculation of replacement commits using wrong offset
Browse files Browse the repository at this point in the history
  • Loading branch information
CelineWuest committed Mar 14, 2024
1 parent 5da0726 commit 84e8402
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/biscepter/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,18 @@ func (r *replica) replaceCommit(commitOffset int) {
if commitOffset >= len(r.commits)-1 {
logrus.Panicf("Passed commit offset %d to replaceCommit is too large! Max allowed length :%d", commitOffset, len(r.commits)-2)
}

// Get the offset of the actual commit to replace
cur := r.commits[commitOffset]
for {
if val, ok := r.parentJob.commitReplacements.Load(cur); ok {
cur = val.(string)
commitOffset++
} else {
break
}
}

next := r.commits[commitOffset+1]

// Store in replacements file for reuse in later runs
Expand Down

0 comments on commit 84e8402

Please sign in to comment.