block alloc: add lifecycle APIs for cache_entry structs
[gitweb.git] / builtin / reset.c
index 7f1c3f02a302128d6c00c35b8783c1a62353b37a..c3f0cfa1e81d02bbfd3e84c7f62ef018c835403b 100644 (file)
@@ -134,7 +134,7 @@ static void update_index_from_diff(struct diff_queue_struct *q,
                        continue;
                }
 
-               ce = make_cache_entry(one->mode, one->oid.hash, one->path,
+               ce = make_cache_entry(&the_index, one->mode, &one->oid, one->path,
                                      0, 0);
                if (!ce)
                        die(_("make_cache_entry failed for path '%s'"),
@@ -314,7 +314,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
        unborn = !strcmp(rev, "HEAD") && get_oid("HEAD", &oid);
        if (unborn) {
                /* reset on unborn branch: treat as reset to empty tree */
-               hashcpy(oid.hash, EMPTY_TREE_SHA1_BIN);
+               oidcpy(&oid, the_hash_algo->empty_tree);
        } else if (!pathspec.nr) {
                struct commit *commit;
                if (get_oid_committish(rev, &oid))