Create a new reference with the same name as the given reference but a different OID target. The reference must be a direct reference, otherwise this will fail.
The new reference will be written to disk, overwriting the given reference.
0 or an error code