diff options
Diffstat (limited to 'name-hash.c')
-rw-r--r-- | name-hash.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/name-hash.c b/name-hash.c index 6d7e1980c6..617c86c537 100644 --- a/name-hash.c +++ b/name-hash.c @@ -150,6 +150,8 @@ static void lazy_init_name_hash(struct index_state *istate) if (istate->name_hash_initialized) return; + if (istate->cache_nr) + preallocate_hash(&istate->name_hash, istate->cache_nr); for (nr = 0; nr < istate->cache_nr; nr++) hash_index_entry(istate, istate->cache[nr]); istate->name_hash_initialized = 1; |