From: Junio C Hamano Date: Mon, 15 Dec 2008 01:03:57 GMT Subject: Re: [PATCH] modify/delete conflict resolution overwrites untracked file Message-ID: <7v63lm1c76.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20081215004651.GA16205@localhost> Clemens Buchacher writes: > On Wed, Dec 10, 2008 at 09:12:59PM +0100, Clemens Buchacher wrote: >> If a file was removed in HEAD, but modified in MERGE_HEAD, recursive merge >> will result in a "CONFLICT (delete/modify)". If the (now untracked) file >> already exists and was not added to the index, it is overwritten with the >> conflict resolution contents. > > The following patch fixes the problem described above, but it also breaks > t6023-merge-rename-nocruft.sh, which tries to merge "A" renamed to "B" in > HEAD and "A" modified in MERGE_HEAD, while ignoring an untracked file "A" in > the working tree. If we want to be able to do this, we have to handle the > other case after rename detection. If the breakage is in merge-recursive but not in merge-resolve, my gut feeling is that we should not be touching unpack-trees at all. With luck I may be able to find some time to take a look at this myself but right now we are entertaining a guest, so....