private static boolean isEnabledForDirectory(@Nullable Project project, @NotNull VirtualFile file) {
    if (project == null) return false;
    final AbstractVcs vcs = ProjectLevelVcsManager.getInstance(project).getVcsFor(file);
    DiffProvider diffProvider = vcs != null ? vcs.getDiffProvider() : null;
    return diffProvider != null && diffProvider.canCompareWithWorkingDir();
  }
private static boolean isEnabledForDirectory(@Nullable Project project, @NotNull VirtualFile file)