operations: use `ExpectedOldOid` in the RPCs which modify the ref
requested to merge 4407-usermergebranch-lacks-ability-to-let-clients-update-a-reference-without-races into master
For RPCs which update the refs, we use the newly added expected_old_oid
, wherein the client is expected to send the OID of the branch or tag to be updated.
This helps avoid race conditions wherein the branch or tag is updated by another RPC before we perform the ref update. By providing the OID we can cross check before the update.
The following RPCs are updated to use the field in a backward compatible manner:
- UserApplyPatch
- UserDeleteBranch
- UserCherryPick
- UserCommitFiles
- UserMergeBranch
- UserFFBranch
- UserRevert
- UserUpdateSubmodule
- UserDeleteTag
Part of #4407 (closed)