void (@NotNull AnActionEvent e) { var project = e.getProject(); Presentation presentation = e.getPresentation(); if (project == null || project.isDisposed() || !project.isOpen()) { presentation.setEnabledAndVisible(false); return; } GitRepository repo = GitBranchUtil.guessWidgetRepository(project, e.getDataContext()); if (repo == null) { presentation.setEnabledAndVisible(false); return; } if (!ToolbarSettings.getInstance().isAvailable()) { presentation.setEnabledAndVisible(false); return; } String branchName = repo.getCurrentRevision() != null ? GitBranchUtil.getDisplayableBranchText(repo) : GitBundle.message("no.revisions.available"); String name = DvcsBranchUtil.shortenBranchName(branchName); presentation.setText(name, false); presentation.setIcon(BranchIconUtil.Companion.getBranchIcon(repo)); presentation.setEnabledAndVisible(true); presentation.setDescription(GitBundle.messagePointer("action.Git.ShowBranches.pretty.description").get()); }