fetch: Add expected_old_oid to prevent races
The expected_old_oid
field has been introduced in many RPCs to help
prevent race conditions. This value indicates what the caller expects a
particular reference to point to before it's updated, and is validated
by Git before the update occurs. If the value changes in the meantime,
an error is returned.
Add expected_old_oid
to the FetchSourceBranch
RPC. In this case, it
indicates the OID that the target reference should point to, before a
source branch is fetched into it. Return a structured gRPC error if the
error occurs.
Edited by James Liu