summaryrefslogtreecommitdiff
path: root/builtin-branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-01-20 10:51:37 -0800
committerJunio C Hamano <junkio@cox.net>2007-01-20 19:19:12 -0800
commit11a6ddb2c8a81815ee9d5411638487ee99770a0b (patch)
tree811512677982d7db5f59e7b0abeea187ae439058 /builtin-branch.c
parent453c1e857534f90b88367f96fc8ca1e7841f9400 (diff)
downloadgit-11a6ddb2c8a81815ee9d5411638487ee99770a0b.tar.gz
branch -f: no reason to forbid updating the current branch in a bare repo.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-branch.c')
-rw-r--r--builtin-branch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-branch.c b/builtin-branch.c
index c760e188ea..25ffa5491c 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.");
}