Skip to content

operations: use `ExpectedOldOid` in the RPCs which modify the ref

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)

Merge request reports