@Override
  public void update(@NotNull AnActionEvent e) {
    final VirtualFile file = VcsContextUtil.selectedFile(e.getDataContext());
    if (file != null && file.isDirectory()) {
      Project project = e.getProject();
      e.getPresentation().setVisible(isVisibleForDirectory(project));
      e.getPresentation().setEnabled(isEnabledForDirectory(project, file));
    }
    else {
      AbstractShowDiffAction.updateDiffAction(e.getPresentation(), e.getDataContext());
    }
  }
@Override
  public void update(@NotNull AnActionEvent e)