read-cache: fix reading of split index
authorThomas Gummerer <t.gummerer@gmail.com>
Fri, 20 Mar 2015 21:43:14 +0000 (22:43 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Mar 2015 21:56:30 +0000 (14:56 -0700)
The split index extension uses ewah bitmaps to mark index entries as
deleted, instead of removing them from the index directly. This can
result in an on-disk index, in which entries of stage #0 and higher
stages appear, which are removed later when the index bases are merged.

15999d0 read_index_from(): catch out of order entries when reading an
index file introduces a check which checks if the entries are in order
after each index entry is read in do_read_index. This check may however
fail when a split index is read.

Fix this by moving checking the index after we know there is no split
index or after the split index bases are successfully merged instead.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found