pull: support rebased upstream + fetch + pull --rebase
[gitweb.git] / preload-index.c
index a6855837a4b85e475d556527335d89c8b0e3a02c..14d52811832d8f2a3f6c1e1e5502c51ce73da82e 100644 (file)
@@ -2,6 +2,14 @@
  * Copyright (C) 2008 Linus Torvalds
  */
 #include "cache.h"
+
+#ifdef NO_PTHREADS
+static void preload_index(struct index_state *index, const char **pathspec)
+{
+       ; /* nothing */
+}
+#else
+
 #include <pthread.h>
 
 /*
@@ -26,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;
@@ -41,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))
@@ -81,6 +93,7 @@ static void preload_index(struct index_state *index, const char **pathspec)
                        die("unable to join threaded lstat");
        }
 }
+#endif
 
 int read_index_preload(struct index_state *index, const char **pathspec)
 {