Subject: Re: [PATCH 1/2] Check order when reading index

From: Junio C Hamano <[email-masked]>
Date: Wed, 27 Aug 2014 14:11:26 -0700

Jaime Soriano Pastor <[email-masked]> writes:

> On Tue, Aug 26, 2014 at 7:43 PM, Junio C Hamano <[email-masked]> wrote:
>> Does the current codebase choke with such entries in the index file,
>> like you saw in your index file with both stage #0 and stage #1
>> entries?
>
> Not sure, I couldn't reproduce an scenario with an index with multiple
> entries in the same stage for the same path.

I think we have been discussing how to protect broken index file
left by tools other people wrote, so I wouldn't be so surprised if
our current toolset does not let you recreate certain breakages ;-)

I was asking for an answer more from what you know about the code.
For example, would read_index_unmerged() choke if the index has two
or more stage #1 (or stage #3) entries for the same path (provided
that the index is otherwise normal, i.e. no stage #0 entry for that
path, entries are sorted by pathname order and stages are in an
order that does not decrease)?