mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-04 02:40:32 +08:00
Given the scenario of 3 peers, A, B, and C each having a project R. If peer A has B's fork, but C does not, then when peer A attempts to fetch from C the fetch will be rejected since Git will fail when a refspec that is asked for does not exist on the remote side. To avoid this, the fetch logic is changed so that the client first calls ls-remote to the remote side, which results in the references that the remote has which the client is interested in. The follow-up fetch then uses these refs as the refspecs -- which should succeed unless there was a race for a deletion on the remote side. The rest of the verification logic stays the same, so the storage should still be in a working state before transferring from the staged repository to the production repository. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett