@Nullable
  @CalledInAny
  public static <T extends Repository> T guessRepositoryForOperation(@NotNull Project project,
                                                                     @NotNull AbstractRepositoryManager<T> manager,
                                                                     @NotNull DataContext dataContext) {
    VirtualFile file = dataContext.getData(CommonDataKeys.VIRTUAL_FILE);
    T repository = manager.getRepositoryForRootQuick(findVcsRootFor(project, file));
    if (repository != null) return repository;

    file = getSelectedFile(dataContext); // last active FileEditor
    repository = manager.getRepositoryForRootQuick(findVcsRootFor(project, file));
    if (repository != null) return repository;

    repository = manager.getRepositoryForRootQuick(guessRootForVcs(project, manager.getVcs(), null));
    if (repository != null) return repository;

    return null;
  }
@Nullable
  @CalledInAny
  public static <T extends Repository> T guessRepositoryForOperation(@NotNull Project project,
                                                                     @NotNull AbstractRepositoryManager<T> manager,
                                                                     @NotNull DataContext dataContext)