public @NlsSafe String run() throws VcsException {
    Ref<VcsException> exRef = Ref.create();
    Ref<String> resultRef = Ref.create();
    addListener(new GitHandlerListener() {
      @Override
      public void processTerminated(final int exitCode) {
        try {
          if (exitCode == 0 || isIgnoredErrorCode(exitCode)) {
            resultRef.set(getStdout());
          }
          else {
            String msg = getStderr();
            if (msg.length() == 0) {
              msg = getStdout();
            }
            if (msg.length() == 0) {
              msg = GitBundle.message("git.error.exit", exitCode);
            }
            exRef.set(new VcsException(msg));
          }
        }
        catch (Throwable t) {
          exRef.set(new VcsException(t.toString(), t));
        }
      }

      @Override
      public void startFailed(final @NotNull Throwable exception) {
        exRef.set(new VcsException(GitBundle.message("git.executable.unknown.error.message", exception.getMessage()), exception));
      }
    });
    try {
      runInCurrentThread();
    }
    catch (IOException e) {
      exRef.set(new VcsException(e.getMessage(), e));
    }
    if (!exRef.isNull()) {
      throw exRef.get();
    }
    if (resultRef.isNull()) {
      throw new VcsException(GitBundle.message("git.error.cant.process.output", printableCommandLine()));
    }
    return resultRef.get();
  }
public @NlsSafe String run()