summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-07-03 22:40:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-07-03 22:40:38 (GMT)
commitac5611a1ccbbb125b65882711e18331a3b91a1ca (patch)
treea7e563babbed434d424ed9b55e3f1e0eebc9a85c /read-cache.c
parenta256a58081e76858a72c41498e23c6c9e67d5127 (diff)
parentc4aa3167fe9dd0b94594c20d8b3673929fcb217d (diff)
downloadgit-ac5611a1ccbbb125b65882711e18331a3b91a1ca.zip
git-ac5611a1ccbbb125b65882711e18331a3b91a1ca.tar.gz
git-ac5611a1ccbbb125b65882711e18331a3b91a1ca.tar.bz2
Merge branch 'fc/do-not-use-the-index-in-add-to-index' into maint
* fc/do-not-use-the-index-in-add-to-index: read-cache: trivial style cleanups read-cache: fix wrong 'the_index' usage
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/read-cache.c b/read-cache.c
index 04ed561..7040e79 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -626,7 +626,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;
@@ -979,7 +979,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.. */
@@ -1449,7 +1449,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)