@Override
  public @Nullable Hash resolveReference(@NotNull GitRepository repository, @NotNull String ref) {
    VirtualFile root = repository.getRoot();
    GitLineHandler handler = new GitLineHandler(repository.getProject(), root, GitCommand.REV_PARSE);
    handler.addParameters("--verify");
    handler.addParameters(ref + "^{commit}");
    GitCommandResult result = Git.getInstance().runCommand(handler);
    String output = result.getOutputAsJoinedString();
    if (result.success()) {
      if (GitUtil.isHashString(output, false)) {
        return HashImpl.build(output);
      }
      else {
        LOG.error("Invalid output for git rev-parse " + ref + " in " + root + ": " + output);
        return null;
      }
    }
    else {
      LOG.debug("Reference [" + ref + "] is unknown to Git in " + root);
      return null;
    }
  }
@Override
  public @Nullable Hash resolveReference(@NotNull GitRepository repository, @NotNull String ref)