merge-recursive: do not barf on "to be removed" entries.
commitac7f0f436e4f45d616ca509f5163fddab104516b
authorJunio C Hamano <junkio@cox.net>
Sat, 7 Apr 2007 12:52:57 +0000 (7 05:52 -0700)
committerJunio C Hamano <junkio@cox.net>
Tue, 10 Apr 2007 19:55:51 +0000 (10 12:55 -0700)
treef8187e88b8088d1dd912716a398524c8e6bde308
parent4c4caafc9cef1031beb46babe9adfdcc03f3cd52
merge-recursive: do not barf on "to be removed" entries.

When update-trees::threeway_merge() decides that a path that
exists in the current index (and HEAD) is to be removed, it
leaves a stage 0 entry whose mode bits are set to 0.  The code
mistook it as "this stage wants the blob here", and proceeded
to call update_file_flags() which ended up trying to put the
mode=0 entry in the index, got very confused, and ended up
barfing with "do not know what to do with 000000".

Since threeway_merge() does not handle case #10 (one side
removes while the other side does not do anything), this is not
a problem while we refuse to merge branches that have D/F
conflicts, but when we start resolving them, we would need to be
able to remove cache entries, and at that point it starts to
matter.

Signed-off-by: Junio C Hamano <junkio@cox.net>
merge-recursive.c