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 Details

    • areAllReachable

      Check if all targets are reachable from the starters 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.
      IOException - if any of the underlying indexes or readers can not be opened.
      Since:
      5.6