git-reset --hard and git-read-tree --reset: fix read_cache_unmerged()

When invalidating unmerged entries in the index, we used to set
their ce_mode to 0 to note the fact that they do not matter
anymore which also made sure that later unpack_trees() call
would not reuse them.  Instead just remove them from the index.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2008-02-21 11:33:56 -08:00
parent 2cd5dfd240
commit f5ed3b30e0
2 changed files with 47 additions and 1 deletions

View File

@ -45,7 +45,7 @@ static int read_cache_unmerged(void)
continue;
cache_tree_invalidate_path(active_cache_tree, ce->name);
last = ce;
ce->ce_flags |= CE_REMOVE;
continue;
}
*dst++ = ce;
}