Merge branch 'fc/do-not-use-the-index-in-add-to-index'

* fc/do-not-use-the-index-in-add-to-index:
  read-cache: trivial style cleanups
  read-cache: fix wrong 'the_index' usage
This commit is contained in:
Junio C Hamano 2013-06-11 13:30:28 -07:00
commit 6bf2227b92

View File

@ -628,7 +628,7 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st,
if (*ptr == '/') {
struct cache_entry *foundce;
++ptr;
foundce = index_name_exists(&the_index, ce->name, ptr - ce->name, ignore_case);
foundce = index_name_exists(istate, ce->name, ptr - ce->name, ignore_case);
if (foundce) {
memcpy((void *)startPtr, foundce->name + (startPtr - ce->name), ptr - startPtr);
startPtr = ptr;
@ -981,7 +981,7 @@ int add_index_entry(struct index_state *istate, struct cache_entry *ce, int opti
if (istate->cache_nr == istate->cache_alloc) {
istate->cache_alloc = alloc_nr(istate->cache_alloc);
istate->cache = xrealloc(istate->cache,
istate->cache_alloc * sizeof(struct cache_entry *));
istate->cache_alloc * sizeof(*istate->cache));
}
/* Add it in.. */
@ -1451,7 +1451,7 @@ int read_index_from(struct index_state *istate, const char *path)
istate->version = ntohl(hdr->hdr_version);
istate->cache_nr = ntohl(hdr->hdr_entries);
istate->cache_alloc = alloc_nr(istate->cache_nr);
istate->cache = xcalloc(istate->cache_alloc, sizeof(struct cache_entry *));
istate->cache = xcalloc(istate->cache_alloc, sizeof(*istate->cache));
istate->initialized = 1;
if (istate->version == 4)