Top Description Fields Constructors Methods
org.eclipse.jgit.internal.revwalk

public Class PedestrianReachabilityChecker

extends Object
implements ReachabilityChecker
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.revwalk.ReachabilityChecker
Imports
java.io.IOException, java.util.Collection, .Iterator, .Optional, java.util.stream.Stream, org.eclipse.jgit.errors.IncorrectObjectTypeException, .MissingObjectException, org.eclipse.jgit.revwalk.ReachabilityChecker, .RevCommit, .RevSort, .RevWalk

Checks the reachability walking the graph from the starters towards the target.

Field Summary

Modifier and TypeField and Description
private final boolean
private final RevWalk

Constructor Summary

AccessConstructor and Description
public
PedestrianReachabilityChecker(boolean
walk commits in topological order
topoSort
,
RevWalk
RevWalk instance to reuse. Caller retains ownership.
walk
)

New instance of the reachability checker using a existing walk.

Method Summary

Modifier and TypeMethod and Description
public Optional<RevCommit>
areAllReachable(Collection<RevCommit>
commits to reach.
targets
,
Stream<RevCommit>
known starting points.
starters
)

Implements org.eclipse.jgit.revwalk.ReachabilityChecker.areAllReachable.

Check if all targets are reachable from the starters commits.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

topoSortback to summary
private final boolean topoSort
walkback to summary
private final RevWalk walk

Constructor Detail

PedestrianReachabilityCheckerback to summary
public PedestrianReachabilityChecker(boolean topoSort, RevWalk walk)

New instance of the reachability checker using a existing walk.

Parameters
topoSort:boolean

walk commits in topological order

walk:RevWalk

RevWalk instance to reuse. Caller retains ownership.

Method Detail

areAllReachableback to summary
public Optional<RevCommit> areAllReachable(Collection<RevCommit> targets, Stream<RevCommit> starters) throws MissingObjectException, IncorrectObjectTypeException, IOException

Implements org.eclipse.jgit.revwalk.ReachabilityChecker.areAllReachable.

Doc from org.eclipse.jgit.revwalk.ReachabilityChecker.areAllReachable.

Check if all targets are reachable from the starters commits.

Caller should parse the objectIds (preferably with walk.parseCommit() and handle missing/incorrect type objects before calling this method.

Parameters
targets:Collection<RevCommit>

commits to reach.

starters:Stream<RevCommit>

known starting points.

Returns:Optional<RevCommit>

An unreachable target if at least one of the targets is unreachable. An empty optional if all targets are reachable from the starters.

Annotations
@Override
Exceptions
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.