Re: [PATCH v5] Verify index file before we opportunistically update it

2014-04-10 Thread Duy Nguyen
On Thu, Apr 10, 2014 at 12:34 PM, Yiannis Marangos yiannis.maran...@gmail.com wrote: +/* + * This function verifies if index_state has the correct sha1 of an index file. + * Don't die if we have any other failure, just return 0. + */ +static int verify_index_from(const struct index_state

Re: [PATCH v5] Verify index file before we opportunistically update it

2014-04-10 Thread Yiannis Marangos
On Thu, Apr 10, 2014 at 05:40:55PM +0700, Duy Nguyen wrote: verify_hdr() is a bit expensive because you need to digest the whole index file (could big as big as 14MB on webkit). Could we get away without it? I mean, is it enough that we pick the last 20 bytes and compare it with istate-sha1?

Re: [PATCH v5] Verify index file before we opportunistically update it

2014-04-10 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: verify_hdr() is a bit expensive because you need to digest the whole index file (could big as big as 14MB on webkit). Could we get away without it? I mean, is it enough that we pick the last 20 bytes and compare it with istate-sha1? If we only need 20