pack-objects: pass fullname down to add_object_entry()
[gitweb.git] / builtin-branch.c
index 6bd5843b47c0bf90c8861d160bacbfad032145e4..a5b6bbef6e903991cf70fd5978f5f89c48c60fb5 100644 (file)
@@ -623,9 +623,10 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
            (rename && force_create))
                usage(builtin_branch_usage);
 
-       head = xstrdup(resolve_ref("HEAD", head_sha1, 0, NULL));
+       head = resolve_ref("HEAD", head_sha1, 0, NULL);
        if (!head)
                die("Failed to resolve HEAD as a valid ref.");
+       head = xstrdup(head);
        if (!strcmp(head, "HEAD")) {
                detached = 1;
        }