block alloc: add lifecycle APIs for cache_entry structs
[gitweb.git] / builtin / difftool.c
index 873a06f0d90f35456d31a28f68ab10c71354e5c9..4593f0c2cd6d4546a66298996ce8001d228d01f4 100644 (file)
@@ -321,10 +321,10 @@ static int checkout_path(unsigned mode, struct object_id *oid,
        struct cache_entry *ce;
        int ret;
 
-       ce = make_cache_entry(mode, oid, path, 0, 0);
+       ce = make_transient_cache_entry(mode, oid, path, 0);
        ret = checkout_entry(ce, state, NULL);
 
-       free(ce);
+       discard_cache_entry(ce);
        return ret;
 }
 
@@ -488,7 +488,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
                                 * index.
                                 */
                                struct cache_entry *ce2 =
-                                       make_cache_entry(rmode, &roid,
+                                       make_cache_entry(&wtindex, rmode, &roid,
                                                         dst_path, 0, 0);
 
                                add_index_entry(&wtindex, ce2,