convert add_files_to_cache to take struct pathspec