From 291c4c61d990fb4411c23d44b7f270dd17354bc0 Mon Sep 17 00:00:00 2001 From: Mads Navntoft Date: Tue, 16 Sep 2025 08:38:39 +0200 Subject: [PATCH] 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. --- internal/push/push.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/push/push.go b/internal/push/push.go index 2851b89..05439b7 100644 --- a/internal/push/push.go +++ b/internal/push/push.go @@ -164,9 +164,10 @@ func (pushService *pushService) createRepository() (*github.Repository, error) { } func splitLargeRefSpecs(refSpecs []config.RefSpec) [][]config.RefSpec { + batchSize := 25 splitRefSpecs := [][]config.RefSpec{} - for i := 0; i < len(refSpecs); i += 25 { - end := i + 100 + for i := 0; i < len(refSpecs); i += batchSize { + end := i + batchSize if end > len(refSpecs) { end = len(refSpecs) }