public static @NotNull GitRevisionNumber resolveReference(@NotNull Project project, @NotNull VirtualFile vcsRoot,
                                                   @NotNull @NonNls String reference) throws VcsException {
    GitLineHandler handler = createRefResolveHandler(project, vcsRoot, reference);
    String output = Git.getInstance().runCommand(handler).getOutputOrThrow();
    StringTokenizer stk = new StringTokenizer(output, "\n\r \t", false);
    if (!stk.hasMoreTokens()) {
      try {
        GitLineHandler dh = new GitLineHandler(project, vcsRoot, GitCommand.LOG);
        dh.addParameters("-1", "HEAD");
        dh.setSilent(true);
        String out = Git.getInstance().runCommand(dh).getOutputOrThrow();
        LOG.info("Diagnostic output from 'git log -1 HEAD': [" + out + "]");
        dh = createRefResolveHandler(project, vcsRoot, reference);
        out = Git.getInstance().runCommand(dh).getOutputOrThrow();
        LOG.info("Diagnostic output from 'git rev-list -1 --timestamp HEAD': [" + out + "]");
      }
      catch (VcsException e) {
        LOG.info("Exception while trying to get some diagnostics info", e);
      }
      throw new VcsException(GitBundle.message("error.git.parse.not.a.revision.number", reference));
    }
    Date timestamp = GitUtil.parseTimestampWithNFEReport(stk.nextToken(), handler, output);
    return new GitRevisionNumber(stk.nextToken(), timestamp);
  }
public static @NotNull GitRevisionNumber resolveReference(@NotNull Project project, @NotNull VirtualFile vcsRoot,
                                                   @NotNull @NonNls String reference)