public static boolean wrap(@NotNull ThrowableRunnable<? extends VcsException> runnable,
                             @NotNull Project project,
                             @NotNull @Nls(capitalization = Nls.Capitalization.Title) String title) {
    final VcsException[] exc = new VcsException[1];
    final Runnable process = () -> {
      try {
        runnable.run();
      }
      catch (VcsException e) {
        exc[0] = e;
      }
    };
    final boolean notCanceled;
    if (ApplicationManager.getApplication().isDispatchThread()) {
      notCanceled = ProgressManager.getInstance().runProcessWithProgressSynchronously(process, title, true, project);
    }
    else {
      process.run();
      notCanceled = true;
    }
    if (exc[0] != null) {
      AbstractVcsHelper.getInstance(project).showError(exc[0], title);
      return false;
    }
    return notCanceled;
  }
public static boolean wrap(@NotNull ThrowableRunnable<? extends VcsException> runnable,
                             @NotNull Project project,
                             @NotNull @Nls(capitalization = Nls.Capitalization.Title) String title)