X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=branch.c;h=62030af4b51abbfb9c488dbf018770f3b3606789;hb=f29ac4f1b04c9cf84509e4a80f27f10b4373a446;hp=5f889fee6b94d2aa517c1a694b20772b9fa20507;hpb=6ba8b079cbe49e2e49bc26a0ca2e47185337142c;p=git.git diff --git a/branch.c b/branch.c index 5f889fee6..62030af4b 100644 --- a/branch.c +++ b/branch.c @@ -134,16 +134,8 @@ void create_branch(const char *head, char *real_ref, msg[PATH_MAX + 20]; struct strbuf ref = STRBUF_INIT; int forcing = 0; - int len; - len = strlen(name); - if (interpret_nth_last_branch(name, &ref) != len) { - strbuf_reset(&ref); - strbuf_add(&ref, name, len); - } - strbuf_splice(&ref, 0, 0, "refs/heads/", 11); - - if (check_ref_format(ref.buf)) + if (strbuf_check_branch_ref(&ref, name)) die("'%s' is not a valid branch name.", name); if (resolve_ref(ref.buf, sha1, 1, NULL)) {