git-update-ref: add --no-deref option for overwriting/detaching ref

git-checkout is also adapted to make use of this new option
instead of the handcrafted command sequence.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Sven Verdoolaege
2007-05-09 12:33:20 +02:00
committed by Junio C Hamano
parent 843142ada0
commit 68db31cc28
10 changed files with 39 additions and 30 deletions

View File

@ -42,7 +42,7 @@ static int update_ref(const char *action,
if (!rla)
rla = "(reflog update)";
snprintf(msg, sizeof(msg), "%s: %s", rla, action);
lock = lock_any_ref_for_update(refname, oldval);
lock = lock_any_ref_for_update(refname, oldval, 0);
if (!lock)
return 1;
if (write_ref_sha1(lock, sha1, msg) < 0)