Skip to content

operations: Use `ExpectedOldOid` in `UserApplyPatch`

Karthik Nayak requested to merge kn-4407-expected-old-oid-1 into master

If the clients provide the ExpectedOldOid in the request of UserApplyPatch, we need to use this as the ref's current OID for updating the reference.

This is directly fed to git-update-ref(1) where it'll exit with an error code if the current OID of the ref doesn't match the OID provided by us. This allows us to avoid any race conditions wherein the branch was updated concurrently by another process.

Part of #4407 (closed)

Edited by Karthik Nayak

Merge request reports