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:
parent
453c1e8575
commit
11a6ddb2c8
@ -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.");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user