public static @Nullable Hash getHead(@NotNull GitRepository repository) {
    GitCommandResult result = Git.getInstance().tip(repository, HEAD);
    if (!result.success()) {
      LOG.warn("Couldn't identify the HEAD for " + repository + ": " + result.getErrorOutputAsJoinedString());
      return null;
    }
    String head = result.getOutputAsJoinedString();
    return HashImpl.build(head);
  }
public static @Nullable Hash getHead(@NotNull GitRepository repository)