private boolean isTagged()

in src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/commit_collector/SinceLastTagCommitCollector.java [76:96]


  private boolean isTagged(Repository repo, RevCommit commit) throws IOException {
    ObjectId commitId = commit.getId();
    try (RevWalk revWalk = new RevWalk(repo)) {
      return repo.getRefDatabase().getRefsByPrefix(Constants.R_TAGS).stream()
          .map(Ref::getObjectId)
          .map(
              refObjectId -> {
                try {
                  return revWalk.parseTag(refObjectId);
                } catch (IncorrectObjectTypeException e) {
                  return null;
                } catch (IOException e) {
                  throw new UncheckedIOException(e);
                }
              })
          .filter(Objects::nonNull)
          .map(RevTag::getObject)
          .map(RevObject::getId)
          .anyMatch(commitId::equals);
    }
  }