Convert struct object to object_id
[gitweb.git] / builtin / clone.c
index 215d015f16483384acef4ed67a3e8570c2410e4c..2cb8cd81fe19973835eb1b161937124a7afeccea 100644 (file)
@@ -657,7 +657,7 @@ static void update_head(const struct ref *our, const struct ref *remote,
        } else if (our) {
                struct commit *c = lookup_commit_reference(our->old_oid.hash);
                /* --branch specifies a non-branch (i.e. tags), detach HEAD */
-               update_ref(msg, "HEAD", c->object.sha1,
+               update_ref(msg, "HEAD", get_object_hash(c->object),
                           NULL, REF_NODEREF, UPDATE_REFS_DIE_ON_ERR);
        } else if (remote) {
                /*