summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2016-04-07 15:03:11 -0400
committerJunio C Hamano <gitster@pobox.com>2016-04-10 11:35:46 -0700
commit41d796ed5cd78d159f8a8bfa3b54bdbe5d9383a3 (patch)
treeb1159d73e0dd45d1cc0f076a07ae49b488d834da /refs
parent2d0663b21661f2677bce5742204ccdd73745a062 (diff)
downloadgit-41d796ed5cd78d159f8a8bfa3b54bdbe5d9383a3.tar.gz
refs: on symref reflog expire, lock symref not referrentdt/pre-refs-backend
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>
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 71848ab9d6..5e67bfae68 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -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);