X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=unpack-trees.c;h=35cb05e92bed9fb273747adc4718458b9f500898;hb=ebbd7439b1b7cce0e8c68fe3e220d71cc58dd980;hp=bf01717015b662cec594d2d3c73e57f409037533;hpb=2ed8ecaf57271e506cefffb5f777f50a6a91a4b4;p=thirdparty%2Fgit.git diff --git a/unpack-trees.c b/unpack-trees.c index bf01717015..35cb05e92b 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -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;