Top Description Methods
org.eclipse.jgit.revwalk

public Interface ReachabilityChecker

Known Direct Implementers
org.eclipse.jgit.internal.revwalk.BitmappedReachabilityChecker, org.eclipse.jgit.internal.revwalk.PedestrianReachabilityChecker
Imports
java.io.IOException, java.util.Collection, .Optional, java.util.stream.Stream, org.eclipse.jgit.errors.IncorrectObjectTypeException, .MissingObjectException

Check if a commit is reachable from a collection of starting commits.

Note that this checks the reachability of commits (and tags). Trees, blobs or any other object will cause IncorrectObjectTypeException exceptions.

Since
5.4

Method Summary

Modifier and TypeMethod and Description
public Optional<RevCommit>

Returns:

An unreachable target if at least one of the targets is unreachable. An empty optional if all targets are reachable from the starters.
areAllReachable
(Collection<RevCommit>
commits to reach.
targets
,
Stream<RevCommit>
known starting points.
starters
)

Check if all targets are reachable from the starters commits.

Method Detail

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

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.

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.
Since
5.6