Skip to content

proto: Add `expected_old_oid` for ref updating RPCs

For RPCs which update the refs, we add 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.

Since the field is optional the rails adaptation of this can happen afterwards.

The following RPCs are updated with the field:

  • UserApplyPatch
  • UserDeleteBranch
  • UserCherryPick
  • UserCommitFiles
  • UserMergeBranch
  • UserFFBranch
  • UserRevert
  • UserUpdateSubmodule
  • UserDeleteTag

Part of #4407 (closed)

Edited by Karthik Nayak

Merge request reports