t7800: run --dir-diff tests with and without symlinks
[gitweb.git] / name-hash.c
index 942c45962252eba4c6f88b4f4f7593c9247749ae..9bac31a6ab7aa80586828e7f48ab829e5b77a740 100644 (file)
@@ -92,6 +92,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;