refs: lock symref that is to be deleted, not its target
commit547d058fb6fefad147675a6d3fdb9439c57916a1
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>
Tue, 16 Oct 2012 10:22:15 +0000 (16 12:22 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Oct 2012 17:08:23 +0000 (16 10:08 -0700)
tree65dc80d8a08aacc7e6e61ac394894bac02fcbdb7
parent0ce2e396ee9fb0fa07e8381b338e49859dbf03db
refs: lock symref that is to be deleted, not its target

When delete_ref is called on a symref then it locks its target and then
either deletes the target or the symref, depending on whether the flag
REF_NODEREF was set in the parameter delopt.

Instead, simply pass the flag to lock_ref_sha1_basic, which will then
either lock the target or the symref, and delete the locked ref.

This reimplements part of eca35a25 (Fix git branch -m for symrefs.).

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c