branch -f: no reason to forbid updating the current branch in a bare repo.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jan 20, 2007 at 10:51 UTC
11a6ddb2c8a81815ee9d5411638487ee99770a0b
1 file changed
+1
-1
builtin-branch.c
+1
-1
@@ -324,7 +324,7 @@ static void create_branch(const char *name, const char *start_name,
324
if (resolve_ref(ref, sha1, 1, NULL)) {
325
if (!force)
326
die("A branch named '%s' already exists.", name);
327
- else if (!strcmp(head, name))
327
+ else if (!is_bare_repository() && !strcmp(head, name))
328
die("Cannot force update the current branch.");
329
}
330