Module org.eclipse.jgit
Class PedestrianReachabilityChecker
- java.lang.Object
-
- org.eclipse.jgit.internal.revwalk.PedestrianReachabilityChecker
-
- All Implemented Interfaces:
ReachabilityChecker
public class PedestrianReachabilityChecker extends Object implements ReachabilityChecker
Checks the reachability walking the graph from the starters towards the target.
-
-
Constructor Summary
Constructors Constructor Description PedestrianReachabilityChecker(boolean topoSort, RevWalk walk)New instance of the reachability checker using a existing walk.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<RevCommit>areAllReachable(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, wait
-
Methods inherited from interface org.eclipse.jgit.revwalk.ReachabilityChecker
areAllReachable
-
-
-
-
Constructor Detail
-
PedestrianReachabilityChecker
public PedestrianReachabilityChecker(boolean topoSort, RevWalk walk)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 Detail
-
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.
-
-