Default ref-update batch to 5000; make it env-tunable

main

Commit

Soph2mo ago

GitHub returns 500 Internal Server Error when a single push updates ~10k refs at once but accepts 5k — well below entire-server's 25k cap. Lower the default batch to 5_000 so mirroring a many-ref repo works against GitHub out of the box, and add GITSYNC_MAX_REF_UPDATES_PER_PUSH to raise it for targets known to tolerate larger pushes (entire-server, up to 25k) and cut round trips.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: 7f01a5ec2f19

Checkpoints

We have a repo with 50k refs and we go this error: 2026/06/18 13:17:39 WARN Permanent sync error, terminating error="sync: replicate relay failed: replicate execute: push target refs: target receive-p

Claude CodeOpus 4.8[1m]
View session
Checkpoint 1