refs: convert update_ref and refs_update_ref to use struct object_id
[gitweb.git] / builtin / checkout.c
index 10751585ea38c282d439e4128c895c01a2598985..2bb009ec0e68c74f54d252d8797356e6e91d2cfb 100644 (file)
@@ -664,7 +664,7 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
        if (!strcmp(new->name, "HEAD") && !new->path && !opts->force_detach) {
                /* Nothing to do. */
        } else if (opts->force_detach || !new->path) {  /* No longer on any branch. */
-               update_ref(msg.buf, "HEAD", new->commit->object.oid.hash, NULL,
+               update_ref(msg.buf, "HEAD", &new->commit->object.oid, NULL,
                           REF_NODEREF, UPDATE_REFS_DIE_ON_ERR);
                if (!opts->quiet) {
                        if (old->path &&
@@ -1297,6 +1297,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
                strbuf_release(&buf);
        }
 
+       UNLEAK(opts);
        if (opts.patch_mode || opts.pathspec.nr)
                return checkout_paths(&opts, new.name);
        else