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 thestarter
commits.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:ReachabilityChecker
Check if all targets are reachable from thestarter
commits.Caller should parse the objectIds (preferably with
walk.parseCommit()
and handle missing/incorrect type objects before calling this method.- Specified by:
areAllReachable
in 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.
-