Merge branch 'sb/branch-avoid-repeated-strbuf-release'
[gitweb.git] / builtin / checkout.c
index 3345a0d16f21c38fe5fe6f32fa5b0a139e21c4a3..10751585ea38c282d439e4128c895c01a2598985 100644 (file)
@@ -1124,9 +1124,8 @@ static int checkout_branch(struct checkout_opts *opts,
 
        if (new->path && !opts->force_detach && !opts->new_branch &&
            !opts->ignore_other_worktrees) {
-               struct object_id oid;
                int flag;
-               char *head_ref = resolve_refdup("HEAD", 0, oid.hash, &flag);
+               char *head_ref = resolve_refdup("HEAD", 0, NULL, &flag);
                if (head_ref &&
                    (!(flag & REF_ISSYMREF) || strcmp(head_ref, new->path)))
                        die_if_checked_out(new->path, 1);