void (@NotNull ProgressIndicator indicator, @NotNull String onto) { GitRepositoryManager repositoryManager = GitUtil.getRepositoryManager(myProject); GitRebaser rebaser = new GitRebaser(myProject, myGit, indicator); VirtualFile root = myRepository.getRoot(); GitLineHandler handler = new GitLineHandler(myProject, root, GitCommand.REBASE); handler.setStdoutSuppressed(false); handler.addParameters(onto); final GitRebaseProblemDetector rebaseConflictDetector = new GitRebaseProblemDetector(); handler.addLineListener(rebaseConflictDetector); final GitUntrackedFilesOverwrittenByOperationDetector untrackedFilesDetector = new GitUntrackedFilesOverwrittenByOperationDetector(root); final GitLocalChangesWouldBeOverwrittenDetector localChangesDetector = new GitLocalChangesWouldBeOverwrittenDetector(root, CHECKOUT); handler.addLineListener(untrackedFilesDetector); handler.addLineListener(localChangesDetector); handler.addLineListener(GitStandardProgressAnalyzer.createListener(indicator)); String oldText = indicator.getText(); indicator.setText(GithubBundle.message("rebase.process.rebasing.onto", onto)); GitCommandResult rebaseResult = myGit.runCommand(handler); indicator.setText(oldText); repositoryManager.updateRepository(root); if (rebaseResult.success()) { root.refresh(false, true); GithubNotifications.showInfo(myProject, GithubNotificationIdsHolder.REBASE_SUCCESS, GithubBundle.message("rebase.process.success"), ""); } else { GitUpdateResult result = rebaser.handleRebaseFailure(handler, root, rebaseResult, rebaseConflictDetector, untrackedFilesDetector, localChangesDetector); if (result == GitUpdateResult.NOTHING_TO_UPDATE || result == GitUpdateResult.SUCCESS || result == GitUpdateResult.SUCCESS_WITH_RESOLVED_CONFLICTS) { GithubNotifications.showInfo(myProject, GithubNotificationIdsHolder.REBASE_SUCCESS, GithubBundle.message("rebase.process.success"), ""); } } }