Makefile: installing git in cygwin 1.7.0
[gitweb.git] / branch.c
index 313bcf16342a956a4f4521c6835bfb382c449da6..62030af4b51abbfb9c488dbf018770f3b3606789 100644 (file)
--- 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_branch_name(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)) {