]> git.ipfire.org Git - thirdparty/git.git/blobdiff - unpack-trees.c
employ new explicit "exists in index?" API
[thirdparty/git.git] / unpack-trees.c
index bf01717015b662cec594d2d3c73e57f409037533..35cb05e92bed9fb273747adc4718458b9f500898 100644 (file)
@@ -1154,8 +1154,10 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
 
        o->src_index = NULL;
        ret = check_updates(o) ? (-2) : 0;
-       if (o->dst_index)
+       if (o->dst_index) {
+               discard_index(o->dst_index);
                *o->dst_index = o->result;
+       }
 
 done:
        clear_exclude_list(&el);
@@ -1355,7 +1357,7 @@ static int icase_exists(struct unpack_trees_options *o, const char *name, int le
 {
        const struct cache_entry *src;
 
-       src = index_name_exists(o->src_index, name, len, 1);
+       src = index_file_exists(o->src_index, name, len, 1);
        return src && !ie_match_stat(o->src_index, src, st, CE_MATCH_IGNORE_VALID|CE_MATCH_IGNORE_SKIP_WORKTREE);
 }
 
@@ -1401,7 +1403,7 @@ static int check_ok_to_remove(const char *name, int len, int dtype,
         * delete this path, which is in a subdirectory that
         * is being replaced with a blob.
         */
-       result = index_name_exists(&o->result, name, len, 0);
+       result = index_file_exists(&o->result, name, len, 0);
        if (result) {
                if (result->ce_flags & CE_REMOVE)
                        return 0;