aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin-branch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-branch.c b/builtin-branch.c
index c760e188e..25ffa5491 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -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.");
}