Imported Upstream version 2.13.3
[platform/upstream/git.git] / preload-index.c
index 968ee25..70a4c80 100644 (file)
@@ -37,9 +37,8 @@ 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;
+       struct cache_def cache = CACHE_DEF_INIT;
 
-       memset(&cache, 0, sizeof(cache));
        nr = p->nr;
        if (nr + p->offset > index->cache_nr)
                nr = index->cache_nr - p->offset;
@@ -54,6 +53,8 @@ static void *preload_thread(void *_data)
                        continue;
                if (ce_uptodate(ce))
                        continue;
+               if (ce_skip_worktree(ce))
+                       continue;
                if (!ce_path_match(ce, &p->pathspec, NULL))
                        continue;
                if (threaded_has_symlink_leading_path(&cache, ce->name, ce_namelen(ce)))
@@ -64,6 +65,7 @@ static void *preload_thread(void *_data)
                        continue;
                ce_mark_uptodate(ce);
        } while (--nr > 0);
+       cache_def_clear(&cache);
        return NULL;
 }