class PedestrianReachabilityChecker extends java.lang.Object implements ReachabilityChecker
Modifier and Type | Field and Description |
---|---|
private boolean |
topoSort |
private RevWalk |
walk |
Constructor and Description |
---|
PedestrianReachabilityChecker(boolean topoSort,
RevWalk walk)
New instance of the reachability checker using a existing walk.
|
Modifier and Type | Method and Description |
---|---|
java.util.Optional<RevCommit> |
areAllReachable(java.util.Collection<RevCommit> targets,
java.util.Collection<RevCommit> starters)
Check if all targets are reachable from the
starter commits. |
private final boolean topoSort
private final RevWalk walk
public PedestrianReachabilityChecker(boolean topoSort, RevWalk walk)
topoSort
- walk commits in topological orderwalk
- RevWalk instance to reuse. Caller retains ownership.public java.util.Optional<RevCommit> areAllReachable(java.util.Collection<RevCommit> targets, java.util.Collection<RevCommit> starters) throws MissingObjectException, IncorrectObjectTypeException, java.io.IOException
ReachabilityChecker
starter
commits.
Caller should parse the objectIds (preferably with
walk.parseCommit()
and handle missing/incorrect type objects
before calling this method.
areAllReachable
in interface ReachabilityChecker
targets
- commits to reach.starters
- known starting points.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.java.io.IOException
- if any of the underlying indexes or readers can not be
opened.