@Nullable
  public static GitReference getCurrentReference(GitRepository repository) {
    GitLocalBranch currentBranch = repository.getCurrentBranch();
    if (currentBranch != null) {
      return currentBranch;
    }
    else {
      String currentRevision = repository.getCurrentRevision();
      if (currentRevision != null) {
        return repository.getTagHolder().getTag(currentRevision);
      }
    }
    return null;
  }
@Nullable
  public static GitReference getCurrentReference(GitRepository repository)