pathspec: convert find_pathspecs_matching_against_index to take an index