refs: on symref reflog expire, lock symref not referrent
When locking a symbolic ref to expire a reflog, lock the symbolic ref (using REF_NODEREF) instead of its referent. Add a test for this. Signed-off-by: David Turner <dturner@twopensource.com> Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
2d0663b216
commit
41d796ed5c
@ -3314,7 +3314,8 @@ int reflog_expire(const char *refname, const unsigned char *sha1,
|
||||
* reference itself, plus we might need to update the
|
||||
* reference if --updateref was specified:
|
||||
*/
|
||||
lock = lock_ref_sha1_basic(refname, sha1, NULL, NULL, 0, &type, &err);
|
||||
lock = lock_ref_sha1_basic(refname, sha1, NULL, NULL, REF_NODEREF,
|
||||
&type, &err);
|
||||
if (!lock) {
|
||||
error("cannot lock ref '%s': %s", refname, err.buf);
|
||||
strbuf_release(&err);
|
||||
|
Reference in New Issue
Block a user