Class BitmappedReachabilityChecker

    • Field Detail

    • Constructor Detail

      • BitmappedReachabilityChecker

        BitmappedReachabilityChecker​(RevWalk walk)
                              throws java.io.IOException
        Parameters:
        walk - walk on the repository to get or create the bitmaps for the commits. It must have bitmaps.
        Throws:
        java.lang.AssertionError - runtime exception if walk is over a repository without bitmaps
        java.io.IOException - if the index or the object reader cannot be opened.
    • Method Detail

      • areAllReachable

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

        In this implementation, it is recommended to put the most popular starters (e.g. refs/heads tips) at the beginning.

        Specified by:
        areAllReachable in interface ReachabilityChecker
        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.