Skip to content

repository: Fix passing zero OID to WriteRef

Patrick Steinhardt requested to merge pks-write-ref-fix-resolve-revision into master

In ceb9161b (repository: Resolve revisions passed to the WriteRef RPC, 2022-07-29) we have refactored the WriteRef() RPC to resolve both old and new revision before executing git-update-ref(1) in order to ensure that the objects we want to update to actually exist. This refactoring broke the case though where the client passes the all-zeroes object ID either as old or new reference, which both have a well-defined meaning in this context.

Fix this bug by special-casing the all-zeroes object ID.

Merge request reports