From: Nguyen Thai Ngoc Duy Date: Thu, 02 Aug 2012 12:20:40 GMT Subject: Re: [PATCH 03/16] Modify match_stat_basic to prepare for other index formats Message-ID: In-Reply-To: <1343905326-23790-4-git-send-email-t.gummerer@gmail.com> 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. > @@ -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. -- Duy