lock_ref_sha1_basic(): remember the original name of a ref when resolving it