Skip to content

Commit 291c4c6

Browse files
committed
Fix overlapping batches in refspec splitting
The splitLargeRefSpecs function had a logic error where it incremented by 25 but used a batch size of 100, creating overlapping batches that pushed the same refs multiple times.
1 parent 304d301 commit 291c4c6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/push/push.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,10 @@ func (pushService *pushService) createRepository() (*github.Repository, error) {
164164
}
165165

166166
func splitLargeRefSpecs(refSpecs []config.RefSpec) [][]config.RefSpec {
167+
batchSize := 25
167168
splitRefSpecs := [][]config.RefSpec{}
168-
for i := 0; i < len(refSpecs); i += 25 {
169-
end := i + 100
169+
for i := 0; i < len(refSpecs); i += batchSize {
170+
end := i + batchSize
170171
if end > len(refSpecs) {
171172
end = len(refSpecs)
172173
}

0 commit comments

Comments
 (0)