X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=preload-index.c;h=92899333c2d8edbed71fdd3a43e19f25a10e5b03;hb=28754ab5f0ce9b4f6ca1641c3e10e2c68bd9b3fc;hp=88edc5f8a9d5384e19426e6adb40e08b34d3adf2;hpb=934747323c397ffe64b6dcdf2bf73128d8e36968;p=git.git diff --git a/preload-index.c b/preload-index.c index 88edc5f8a..92899333c 100644 --- a/preload-index.c +++ b/preload-index.c @@ -34,7 +34,9 @@ static void *preload_thread(void *_data) struct thread_data *p = _data; struct index_state *index = p->index; struct cache_entry **cep = index->cache + p->offset; + struct cache_def cache; + memset(&cache, 0, sizeof(cache)); nr = p->nr; if (nr + p->offset > index->cache_nr) nr = index->cache_nr - p->offset; @@ -49,6 +51,8 @@ static void *preload_thread(void *_data) continue; if (!ce_path_match(ce, p->pathspec)) continue; + if (threaded_has_symlink_leading_path(&cache, ce->name, ce_namelen(ce))) + continue; if (lstat(ce->name, &st)) continue; if (ie_match_stat(index, ce, &st, CE_MATCH_RACY_IS_DIRTY)) @@ -72,7 +76,7 @@ static void preload_index(struct index_state *index, const char **pathspec) if (threads > MAX_PARALLEL) threads = MAX_PARALLEL; offset = 0; - work = (index->cache_nr + threads - 1) / threads; + work = DIV_ROUND_UP(index->cache_nr, threads); for (i = 0; i < threads; i++) { struct thread_data *p = data+i; p->index = index;