Discard "deleted" cache entries after using them to update the working tree
commit33ecf7eb6143143711ccaf828134beb2dacbe5c9
authorDaniel Barkalow <barkalow@iabervon.org>
Thu, 7 Feb 2008 16:39:59 +0000 (7 11:39 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sun, 10 Feb 2008 07:16:51 +0000 (9 23:16 -0800)
tree9d6a9b2a764dc2fe2d9b171835c690ce11a26fa2
parentb05c6dff8aa8af5a03717e8d863b911cede213a0
Discard "deleted" cache entries after using them to update the working tree

Way back in read-tree.c, we used a mode 0 cache entry to indicate that
an entry had been deleted, so that the update code would remove the
working tree file, and we would just skip it when writing out the
index file afterward.

These days, unpack_trees is a library function, and it is still
leaving these entries in the active cache. Furthermore, unpack_trees
doesn't correctly ignore those entries, and who knows what other code
wouldn't expect them to be there, but just isn't yet called after a
call to unpack_trees. To avoid having other code trip over these
entries, have check_updates() remove them after it removes the working
tree files.

While we're at it, simplify the loop in check_updates(), and avoid
passing global variables as parameters to check_updates(): there is
only one call site anyway.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
unpack-trees.c