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

@ -209,7 +209,7 @@ static const char *update(struct command *cmd)
return NULL; /* good */
}
else {
lock = lock_any_ref_for_update(name, old_sha1);
lock = lock_any_ref_for_update(name, old_sha1, 0);
if (!lock) {
error("failed to lock %s", name);
return "failed to lock";