diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-05-30 11:59:16 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-05-30 11:59:16 -0700 |
| commit | 8ddea85fd7a13cd40f33c6dd54ed43b1a5f47d5e (patch) | |
| tree | 42b9361e72a7c700cad8e9c7efde489c3b4cfec2 | |
| parent | 48a25bbbbb26f7d140986a9f2a1d5d6c68eec6a4 (diff) | |
| parent | 2e60aabc759e3467e21a98f4e739c5e9f221cd9f (diff) | |
| download | git-8ddea85fd7a13cd40f33c6dd54ed43b1a5f47d5e.tar.gz | |
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
| -rw-r--r-- | name-hash.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/name-hash.c b/name-hash.c index d66de1cdfd..b91e276267 100644 --- a/name-hash.c +++ b/name-hash.c @@ -492,8 +492,10 @@ static void *lazy_name_thread_proc(void *_data) for (k = 0; k < d->istate->cache_nr; k++) { struct cache_entry *ce_k = d->istate->cache[k]; ce_k->ce_flags |= CE_HASHED; - hashmap_entry_init(&ce_k->ent, d->lazy_entries[k].hash_name); - hashmap_add(&d->istate->name_hash, &ce_k->ent); + if (!S_ISSPARSEDIR(ce_k->ce_mode)) { + hashmap_entry_init(&ce_k->ent, d->lazy_entries[k].hash_name); + hashmap_add(&d->istate->name_hash, &ce_k->ent); + } } return NULL; |
