Re: [PATCH 1/2] Check order when reading index
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 27, 2014, 21:11 UTC
- Message-ID
- <xmqq61hdd4e9.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CAPuZ2NFzHjUSfi1H0RFvOuWdRptwxv-gsUOAJv0Uh5BFLWmnRA@mail.gmail.com>
Jaime Soriano Pastor <jsorianopastor@gmail.com> writes:
Show 7 quoted lines
> On Tue, Aug 26, 2014 at 7:43 PM, Junio C Hamano <gitster@pobox.com> 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)?