private @Nullable PushUpdateSettings showDialogAndGetExitCode(final @NotNull Set<? extends GitRepository> repositories,
                                                                final @NotNull PushUpdateSettings initialSettings,
                                                                final boolean rebaseOverMergeProblemDetected) {
    Ref<PushUpdateSettings> updateSettings = Ref.create();
    ApplicationManager.getApplication().invokeAndWait(() -> {
      GitRejectedPushUpdateDialog dialog = new GitRejectedPushUpdateDialog(
        myProject, repositories, initialSettings, rebaseOverMergeProblemDetected
      );

      PushRejectedExitCode exitCode = dialog.showAndGet();
      if (!exitCode.equals(PushRejectedExitCode.CANCEL)) {
        mySettings.setAutoUpdateIfPushRejected(dialog.getShouldAutoUpdateInFuture());
        updateSettings.set(new PushUpdateSettings(convertUpdateMethodFromDialogExitCode(exitCode)));
      }
    });
    return updateSettings.get();
  }
private @Nullable PushUpdateSettings showDialogAndGetExitCode(final @NotNull Set<? extends GitRepository> repositories,
                                                                final @NotNull PushUpdateSettings initialSettings,
                                                                final boolean rebaseOverMergeProblemDetected)