From: Thomas Gummerer Date: Thu, 02 Aug 2012 14:16:26 GMT Subject: Re: [PATCH 03/16] Modify match_stat_basic to prepare for other index formats Message-ID: <20120802141626.GE1000@tgummerer.unibz.it> In-Reply-To: On 08/02, Nguyen Thai Ngoc Duy wrote: > On Thu, Aug 2, 2012 at 6:01 PM, Thomas Gummerer wrote: > > @@ -1443,7 +1452,6 @@ void read_index_v2(struct index_state *istate, void *mmap, int mmap_size) > > src_offset += consumed; > > } > > strbuf_release(&previous_name_buf); > > - > > while (src_offset <= mmap_size - 20 - 8) { > > /* After an array of active_nr index entries, > > * there can be arbitrary number of extended > > @@ -1500,7 +1508,6 @@ int read_index_from(struct index_state *istate, const char *path) > > die("index file smaller than expected"); > > > > mmap = xmmap(NULL, mmap_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); > > - close(fd); > > if (mmap == MAP_FAILED) > > die_errno("unable to map index file"); > > > > @@ -1512,7 +1519,6 @@ int read_index_from(struct index_state *istate, const char *path) > > goto unmap; > > > > read_index_v2(istate, mmap, mmap_size); > > - > > istate->timestamp.sec = st.st_mtime; > > istate->timestamp.nsec = ST_MTIME_NSEC(st); > > > > you could have done this in 02/16 when you introduced this block. Thanks. > > @@ -1802,9 +1808,6 @@ int write_index(struct index_state *istate, int newfd) > > } > > } > > > > - if (!istate->version) > > - istate->version = INDEX_FORMAT_DEFAULT; > > - > > /* demote version 3 to version 2 when the latter suffices */ > > if (istate->version == 3 || istate->version == 2) > > istate->version = extended ? 3 : 2; > > why? it does not seem to be related to the commit message. Sorry this is wrong, it should belong to patch 4. Thanks for noticing.