Re: [PATCH] Check order when reading index
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Aug 21, 2014, 13:59 UTC
- Message-ID
- <CACsJy8A-aMmU0oYgo=eR21CZT6X__-Mnrg6O74sCQ9Ta4QPWPQ@mail.gmail.com>
- In-Reply-To
- <1408628606-12975-1-git-send-email-jsorianopastor@gmail.com>
On Thu, Aug 21, 2014 at 8:43 PM, Jaime Soriano Pastor <jsorianopastor@gmail.com> wrote:
Show 10 quoted lines
> @@ -1499,6 +1514,9 @@ int read_index_from(struct index_state *istate, const char *path) > ce = create_from_disk(disk_ce, &consumed, previous_name); > set_index_entry(istate, i, ce); > > + if (i > 0) > + check_next_ce(istate->cache[i-1], ce); > + > src_offset += consumed; > } > strbuf_release(&previous_name_buf);
It may be nice to save the "good index" stamp as an index extension so we don't have to check this over and over. I'm thinking about big indexes where compare cost might matter (I'm not so sure yet, will do some testing when I have time).
-- Duy