refs: pass NULL to resolve_refdup() if hash is not needed
[gitweb.git] / builtin / checkout.c
index 5c202b7af57e26f5171eb8a83b107fceeb747488..531f7720f3ecde335bb3c2caed3655f98e573df3 100644 (file)
@@ -1116,9 +1116,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);