Re: [BUG] diffcore-rename with duplicate tree entries can segfault
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 24, 2015, 22:42 UTC
- Message-ID
- <xmqqh9uborrx.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20150224214311.GA8622@peff.net>
Jeff King <peff@peff.net> 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.
Show 7 quoted lines
> ... > 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.