X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=branch.c;h=93dc866f8c09a2da2308c4fd677178b043f2d4d5;hb=fd5c363da4635d81f29193ae19d8fa7b5657ab39;hp=2ab42aaf4da38b4ea45ef7f0a0f6b807313d4a22;hpb=78f17935a306dfd7a1f32c923e0b05a094bf0c25;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; }