branch -f: no reason to forbid updating the current branch in a bare repo.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2007-01-20 10:51:37 -08:00
parent 453c1e8575
commit 11a6ddb2c8

View file

@ -324,7 +324,7 @@ static void create_branch(const char *name, const char *start_name,
if (resolve_ref(ref, sha1, 1, NULL)) {
if (!force)
die("A branch named '%s' already exists.", name);
else if (!strcmp(head, name))
else if (!is_bare_repository() && !strcmp(head, name))
die("Cannot force update the current branch.");
}