Skip to content

Commit 8ddea85

Browse files
committed
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
2 parents 48a25bb + 2e60aab commit 8ddea85

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

name-hash.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,10 @@ static void *lazy_name_thread_proc(void *_data)
492492
for (k = 0; k < d->istate->cache_nr; k++) {
493493
struct cache_entry *ce_k = d->istate->cache[k];
494494
ce_k->ce_flags |= CE_HASHED;
495-
hashmap_entry_init(&ce_k->ent, d->lazy_entries[k].hash_name);
496-
hashmap_add(&d->istate->name_hash, &ce_k->ent);
495+
if (!S_ISSPARSEDIR(ce_k->ce_mode)) {
496+
hashmap_entry_init(&ce_k->ent, d->lazy_entries[k].hash_name);
497+
hashmap_add(&d->istate->name_hash, &ce_k->ent);
498+
}
497499
}
498500

499501
return NULL;

0 commit comments

Comments
 (0)