Class PedestrianReachabilityChecker
java.lang.Object
org.eclipse.jgit.internal.revwalk.PedestrianReachabilityChecker
- All Implemented Interfaces:
ReachabilityChecker
Checks the reachability walking the graph from the starters towards the
target.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPedestrianReachabilityChecker(boolean topoSort, RevWalk walk) New instance of the reachability checker using a existing walk. -
Method Summary
Modifier and TypeMethodDescriptionareAllReachable(Collection<RevCommit> targets, Stream<RevCommit> starters) Check if all targets are reachable from thestartercommits.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.jgit.revwalk.ReachabilityChecker
areAllReachable
-
Field Details
-
topoSort
private final boolean topoSort -
walk
-
-
Constructor Details
-
PedestrianReachabilityChecker
New instance of the reachability checker using a existing walk.- Parameters:
topoSort- walk commits in topological orderwalk- RevWalk instance to reuse. Caller retains ownership.
-
-
Method Details
-
areAllReachable
public Optional<RevCommit> areAllReachable(Collection<RevCommit> targets, Stream<RevCommit> starters) throws MissingObjectException, IncorrectObjectTypeException, IOException Description copied from interface:ReachabilityCheckerCheck if all targets are reachable from thestartercommits.Caller should parse the objectIds (preferably with
walk.parseCommit()and handle missing/incorrect type objects before calling this method.- Specified by:
areAllReachablein interfaceReachabilityChecker- 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.
-