@RequiresBackgroundThread
  private static @NotNull Map<VirtualFile, List<VirtualFile>> sortFilesByGitRoot(@NotNull Project project,
                                                                                 @NotNull Collection<? extends VirtualFile> virtualFiles,
                                                                                 boolean ignoreNonGit)
    throws VcsException {
    Map<GitRepository, List<VirtualFile>> map = sortFilesByRepository(project, virtualFiles, ignoreNonGit);

    Map<VirtualFile, List<VirtualFile>> result = new HashMap<>();
    map.forEach((repo, files) -> result.put(repo.getRoot(), files));
    return result;
  }
@RequiresBackgroundThread
  private static @NotNull Map<VirtualFile, List<VirtualFile>> sortFilesByGitRoot(@NotNull Project project,
                                                                                 @NotNull Collection<? extends VirtualFile> virtualFiles,
                                                                                 boolean ignoreNonGit)