Interface ReachabilityChecker

  • All Known Implementing Classes:
    BitmappedReachabilityChecker, PedestrianReachabilityChecker

    public interface ReachabilityChecker
    Check if a commit is reachable from a collection of starting commits.

    Note that this checks the reachability of commits (and tags). Trees, blobs or any other object will cause IncorrectObjectTypeException exceptions.

    Since:
    5.4
    • Method Detail

      • areAllReachable

        @Deprecated
        default java.util.Optional<RevCommit> areAllReachable​(java.util.Collection<RevCommit> targets,
                                                              java.util.Collection<RevCommit> starters)
                                                       throws MissingObjectException,
                                                              IncorrectObjectTypeException,
                                                              java.io.IOException
        Check if all targets are reachable from the starter commits.

        Caller should parse the objectIds (preferably with walk.parseCommit() and handle missing/incorrect type objects before calling this method.

        Parameters:
        targets - commits to reach.
        starters - known starting points.
        Returns:
        An unreachable target if at least one of the targets is unreachable. An empty optional if all targets are reachable from the starters.
        Throws:
        MissingObjectException - if any of the incoming objects doesn't exist in the repository.
        IncorrectObjectTypeException - if any of the incoming objects is not a commit or a tag.
        java.io.IOException - if any of the underlying indexes or readers can not be opened.
      • areAllReachable

        java.util.Optional<RevCommit> areAllReachable​(java.util.Collection<RevCommit> targets,
                                                      java.util.stream.Stream<RevCommit> starters)
                                               throws MissingObjectException,
                                                      IncorrectObjectTypeException,
                                                      java.io.IOException
        Check if all targets are reachable from the starter commits.

        Caller should parse the objectIds (preferably with walk.parseCommit() and handle missing/incorrect type objects before calling this method.

        Parameters:
        targets - commits to reach.
        starters - known starting points.
        Returns:
        An unreachable target if at least one of the targets is unreachable. An empty optional if all targets are reachable from the starters.
        Throws:
        MissingObjectException - if any of the incoming objects doesn't exist in the repository.
        IncorrectObjectTypeException - if any of the incoming objects is not a commit or a tag.
        java.io.IOException - if any of the underlying indexes or readers can not be opened.
        Since:
        5.6