Skip to content

Commit d12ebc6

Browse files
committed
name-hash: don't add sparse directories in threaded lazy init
Similarly to 5f11669 make sure to avoid placing sparse directories into the name_hash hashtable whenever multithreaded initialization is performed. Sparse directory entries represent a directory that is outside the sparse-checkout definition. These are not paths to blobs, so should not be added to the name_hash table as they must never be queried. Signed-off-by: Alex Mironov <[email protected]>
1 parent 8613c2b commit d12ebc6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

name-hash.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,9 @@ 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+
if (S_ISSPARSEDIR(ce_k->ce_mode)) {
496+
continue;
497+
}
495498
hashmap_entry_init(&ce_k->ent, d->lazy_entries[k].hash_name);
496499
hashmap_add(&d->istate->name_hash, &ce_k->ent);
497500
}

0 commit comments

Comments
 (0)