Class PedestrianObjectReachabilityChecker

java.lang.Object
org.eclipse.jgit.internal.revwalk.PedestrianObjectReachabilityChecker
All Implemented Interfaces:
ObjectReachabilityChecker

public class PedestrianObjectReachabilityChecker extends Object implements ObjectReachabilityChecker
Checks if all objects are reachable from certain starting points doing a walk.
  • Field Details

  • Constructor Details

    • PedestrianObjectReachabilityChecker

      public PedestrianObjectReachabilityChecker(ObjectWalk walk)
      New instance of the reachability checker using a existing walk.
      Parameters:
      walk - ObjectWalk instance to reuse. Caller retains ownership.
  • Method Details

    • areAllReachable

      public Optional<RevObject> areAllReachable(Collection<RevObject> targets, Stream<RevObject> starters) throws IOException
      Checks that all targets are reachable from the starters.
      Specified by:
      areAllReachable in interface ObjectReachabilityChecker
      Parameters:
      targets - objects to check for reachability from the starters
      starters - objects known to be reachable to the caller
      Returns:
      Optional a single unreachable target if there are any (there could be more). Empty optional means all targets are reachable.
      Throws:
      IOException - Cannot access underlying storage