]> git.ipfire.org Git - thirdparty/git.git/blobdiff - branch.c
strbuf_branchname(): a wrapper for branch name shorthands
[thirdparty/git.git] / branch.c
index 313bcf16342a956a4f4521c6835bfb382c449da6..558f092701f7aa797a0b38a48f67fef6f0218f9c 100644 (file)
--- a/branch.c
+++ b/branch.c
@@ -134,13 +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_branchname(&ref, name);
        strbuf_splice(&ref, 0, 0, "refs/heads/", 11);
 
        if (check_ref_format(ref.buf))