pack-objects: pass fullname down to add_object_entry()
[gitweb.git] / builtin-branch.c
index 7408285050a0f41a33d31c73e79c2fdefe567593..a5b6bbef6e903991cf70fd5978f5f89c48c60fb5 100644 (file)
@@ -462,7 +462,7 @@ static void create_branch(const char *name, const char *start_name,
                die("Not a valid branch point: '%s'.", start_name);
        hashcpy(sha1, commit->object.sha1);
 
-       lock = lock_any_ref_for_update(ref, NULL);
+       lock = lock_any_ref_for_update(ref, NULL, 0);
        if (!lock)
                die("Failed to lock ref for update: %s.", strerror(errno));
 
@@ -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;
        }