Fix push 422: use all cached remote heads as have anchors
The previous fix queried GET /refs to get the target remote's heads, but those commit IDs often don't exist in the local object store (e.g. when the remote received commits via GitHub PR merges that were never fetched locally). build_pack's BFS can't stop at commits it can't find, so it walks the entire history.
The correct fallback: use ALL cached tracking refs across every configured remote (.muse/remotes/**/*). Any commit the machine has previously pushed to any remote IS in the local object store AND is a shared ancestor with mirrors/forks. This lets build_pack stop at the nearest known common ancestor and send only the delta (3 commits, ~424 objects) rather than the full repo (2338 objects → 422 too_long).
No comments yet. Be the first to start the discussion.