gitweb: Strip non-printable characters from syntax highlighter output
[gitweb.git] / branch.c
index ff84b5b9b70280123343c20db66424f7dee349c6..478d82567d7773d62c686d73780659b86594eede 100644 (file)
--- a/branch.c
+++ b/branch.c
@@ -146,7 +146,7 @@ int validate_new_branchname(const char *name, struct strbuf *ref, int force)
        if (!ref_exists(ref->buf))
                return 0;
        else if (!force)
-               die("A branch named '%s' already exists.", name);
+               die("A branch named '%s' already exists.", ref->buf + strlen("refs/heads/"));
 
        head = resolve_ref("HEAD", sha1, 0, NULL);
        if (!is_bare_repository() && head && !strcmp(head, ref->buf))
@@ -224,7 +224,7 @@ void create_branch(const char *head,
                         start_name);
 
        if (real_ref && track)
-               setup_tracking(name, real_ref, track);
+               setup_tracking(ref.buf+11, real_ref, track);
 
        if (!dont_change_ref)
                if (write_ref_sha1(lock, sha1, msg) < 0)