From: Junio C Hamano Date: Sat, 20 Jan 2007 18:51:37 +0000 (-0800) Subject: branch -f: no reason to forbid updating the current branch in a bare repo. X-Git-Tag: v1.5.0-rc2~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=11a6ddb2c8a81815ee9d5411638487ee99770a0b;p=git.git branch -f: no reason to forbid updating the current branch in a bare repo. Signed-off-by: Junio C Hamano --- 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."); }