void (@NotNull AnActionEvent e) { final Project project = e.getRequiredData(CommonDataKeys.PROJECT); ArrayList<GitRepository> repositories = new ArrayList<>(getRepositories(project)); repositories.removeAll(getRebasingRepositories(project)); List<VirtualFile> roots = new ArrayList<>(getRootsFromRepositories(sortRepositories(repositories))); GitRepository selectedRepo = GitBranchUtil.guessRepositoryForOperation(project, e.getDataContext()); VirtualFile defaultRoot = selectedRepo != null ? selectedRepo.getRoot() : null; final GitRebaseDialog dialog = new GitRebaseDialog(project, roots, defaultRoot); if (dialog.showAndGet()) { VirtualFile root = dialog.gitRoot(); GitRebaseParams selectedParams = dialog.getSelectedParams(); ProgressManager.getInstance().run(new Task.Backgroundable(project, GitBundle.message("rebase.progress.indicator.title")) { @Override public void run(@NotNull ProgressIndicator indicator) { GitRepository selectedRepository = Objects.requireNonNull(GitRepositoryManager.getInstance(project).getRepositoryForRoot(root)); GitRebaseUtils.rebase(project, singletonList(selectedRepository), selectedParams, indicator); } }); } }