public static @Nullable List<VirtualFile> getGitRoots(Project project, GitVcs vcs) {
    try {
      VirtualFile[] contentRoots = ProjectLevelVcsManager.getInstance(project).getRootsUnderVcs(vcs);
      if (ArrayUtil.isEmpty(contentRoots)) {
        throw new VcsException(GitBundle.message("repository.action.missing.roots.unconfigured.message"));
      }

      Collection<GitRepository> repositories = GitUtil.getRepositories(project);
      if (repositories.isEmpty()) {
        throw new VcsException(GitBundle.message("repository.action.missing.roots.misconfigured"));
      }

      return DvcsUtil.sortVirtualFilesByPresentation(GitUtil.getRootsFromRepositories(repositories));
    }
    catch (VcsException e) {
      Messages.showErrorDialog(project, e.getMessage(), GitBundle.message("repository.action.missing.roots.title"));
      return null;
    }
  }
public static @Nullable List<VirtualFile> getGitRoots(Project project, GitVcs vcs)