X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=preload-index.c;h=14d52811832d8f2a3f6c1e1e5502c51ce73da82e;hb=e7ec9de67639d7c1715b450f54d297cc38e25867;hp=88edc5f8a9d5384e19426e6adb40e08b34d3adf2;hpb=652f0c8f1df362755253fe9c5a975be7e5a5cbdc;p=git.git diff --git a/preload-index.c b/preload-index.c index 88edc5f8a..e3d0bda31 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; @@ -45,10 +47,14 @@ static void *preload_thread(void *_data) if (ce_stage(ce)) continue; + if (S_ISGITLINK(ce->ce_mode)) + continue; if (ce_uptodate(ce)) 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 +78,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;