convert read_cache_preload() to take struct pathspec