X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=branch.c;h=93dc866f8c09a2da2308c4fd677178b043f2d4d5;hb=eec0daf6fd5a31cda601caeaa3a0bfebf2d17fe8;hp=2ab42aaf4da38b4ea45ef7f0a0f6b807313d4a22;hpb=b92cbb62def240268c1af39f1a688fec8d34ac9b;p=git.git diff --git a/branch.c b/branch.c index 2ab42aaf4..93dc866f8 100644 --- a/branch.c +++ b/branch.c @@ -159,7 +159,7 @@ void create_branch(const char *head, dont_change_ref = 1; else if (!force) die("A branch named '%s' already exists.", name); - else if (!is_bare_repository() && !strcmp(head, name)) + else if (!is_bare_repository() && head && !strcmp(head, name)) die("Cannot force update the current branch."); forcing = 1; }