Thread (31 messages) flat view 31 messages, 2 authors, 2016-06-15

Re: [PATCH 03/16] Modify match_stat_basic to prepare for other index formats

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:54:24

On Thu, Aug 2, 2012 at 6:01 PM, Thomas Gummerer [off-list ref] wrote:
quoted hunk ↗ jump to hunk
@@ -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.
quoted hunk ↗ jump to hunk
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help