GitRebaseCommandResult (@NotNull GitLineHandler handler, @NotNull GitRebaseEditorHandler editorHandler) { try (GitHandlerRebaseEditorManager ignored = GitHandlerRebaseEditorManager.prepareEditor(handler, editorHandler)) { GitCommandResult result = runCommand(handler); if (editorHandler.wasCommitListEditorCancelled()) return GitRebaseCommandResult.cancelledInCommitList(result); if (editorHandler.wasUnstructuredEditorCancelled()) return GitRebaseCommandResult.cancelledInCommitMessage(result); return GitRebaseCommandResult.normal(result); } }