Merge branch 'am/sparse-index-name-hash-fix'
Avoid adding directory path to a sparse-index tree entries to the name-hash, since they would bloat the hashtable without anybody querying for them. This was done already for a single threaded part of the code, but now the multi-threaded code also does the same. * am/sparse-index-name-hash-fix: name-hash: don't add sparse directories in threaded lazy init
This commit is contained in:
@@ -492,8 +492,10 @@ static void *lazy_name_thread_proc(void *_data)
|
|||||||
for (k = 0; k < d->istate->cache_nr; k++) {
|
for (k = 0; k < d->istate->cache_nr; k++) {
|
||||||
struct cache_entry *ce_k = d->istate->cache[k];
|
struct cache_entry *ce_k = d->istate->cache[k];
|
||||||
ce_k->ce_flags |= CE_HASHED;
|
ce_k->ce_flags |= CE_HASHED;
|
||||||
hashmap_entry_init(&ce_k->ent, d->lazy_entries[k].hash_name);
|
if (!S_ISSPARSEDIR(ce_k->ce_mode)) {
|
||||||
hashmap_add(&d->istate->name_hash, &ce_k->ent);
|
hashmap_entry_init(&ce_k->ent, d->lazy_entries[k].hash_name);
|
||||||
|
hashmap_add(&d->istate->name_hash, &ce_k->ent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user