strategy: push the queued ref spelling that resolves locally

Commit

Stefan Haubold3d ago

A push queue written before folded-ref handling holds canonical ref names. Once git packs such a ref under its filesystem-selected shard directory the canonical name stops resolving, and partitionLocalRefs classified it as STALE โ€” never pushable, so drop it. The queue entry was removed and the checkpoint was silently never pushed, permanently.

partitionLocalRefs now resolves each queued name to the spelling that exists locally before deciding, which also covers the OPF pre-push rewrite: it reaches the same helper through Peek and never normalizes. flushCheckpointRefsQueue additionally rewrites the queue itself, so the stale spelling stops costing a lookup on every later push.

Only a definite ErrReferenceNotFound triggers the rewrite โ€” a transient lookup failure keeps the queued name rather than rewriting a queue entry on a flaky read. The rewrite enqueues before removing, so an interrupted normalization leaves the checkpoint queued twice (Drain dedups) rather than dropping it.

Refs #2402

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com Entire-Checkpoint: 01M2JVRY0CGP9H9NSFS7MPXES2