X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=branch.c;h=93dc866f8c09a2da2308c4fd677178b043f2d4d5;hb=7e4eb210bdf2a612d8bf4cc106d99ba190f73e3e;hp=2ab42aaf4da38b4ea45ef7f0a0f6b807313d4a22;hpb=0a4139b5f283ef5e817afaafd9e7e2a149220cc4;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; }