Merge branch 'jk/fast-import-fixes'
[gitweb.git] / read-cache.c
index acb132d8bf596061f10fb5743ec7e71da8e8d633..b5917e0c0743af3c831f9571e19e269e8a1f6014 100644 (file)
@@ -1064,6 +1064,14 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,
                return ce;
        }
 
+       if (has_symlink_leading_path(ce->name, ce_namelen(ce))) {
+               if (ignore_missing)
+                       return ce;
+               if (err)
+                       *err = ENOENT;
+               return NULL;
+       }
+
        if (lstat(ce->name, &st) < 0) {
                if (ignore_missing && errno == ENOENT)
                        return ce;