void (@NotNull AnActionEvent e) { Project project = e.getProject(); Presentation presentation = e.getPresentation(); if (project == null || !hasGitRepositories(project) || !getRebasingRepositories(project).isEmpty()) { presentation.setEnabledAndVisible(false); } else if (getRepositoriesInState(project, Repository.State.NORMAL).isEmpty()) { presentation.setEnabled(false); } else { presentation.setEnabledAndVisible(true); } }