Subject: Re: [BUG] diffcore-rename with duplicate tree entries can segfault

From: Junio C Hamano <[email-masked]>
Date: Tue, 24 Feb 2015 14:42:42 -0800

Jeff King <[email-masked]> writes:

> I ran across a real-world case where git segfaults on some trees that
> have duplicate entries. Those trees are obviously broken, and I'm fine
> with us producing whatever output we like on them. But probably we
> shouldn't segfault.

Thanks.

> ...
> That does fix this problem, and it doesn't break any other tests. But
> frankly, I don't know what I'm doing and this feels like a giant hack.
>
> Given that this is tangentially related to the "-B -M" stuff you've been
> looking at (and it's your code in the first place :) ), I thought you
> might have some insight.

Indeed.

Honestly, I'd rather see us diagnose duplicate filepairs as an error
and drop them on the floor upon entry to the diffcore_std(), even
before we go into the rename codepath.