Package org.eclipse.jgit.revwalk
Interface ReachabilityChecker
- All Known Implementing Classes:
BitmappedReachabilityChecker
,PedestrianReachabilityChecker
public interface ReachabilityChecker
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 TypeMethodDescriptionareAllReachable
(Collection<RevCommit> targets, Collection<RevCommit> starters) Deprecated.areAllReachable
(Collection<RevCommit> targets, Stream<RevCommit> starters) Check if all targets are reachable from thestarter
commits.
-
Method Details
-
areAllReachable
@Deprecated default Optional<RevCommit> areAllReachable(Collection<RevCommit> targets, Collection<RevCommit> starters) throws MissingObjectException, IncorrectObjectTypeException, IOException Deprecated.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.- 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.
-
areAllReachable
Optional<RevCommit> areAllReachable(Collection<RevCommit> targets, Stream<RevCommit> starters) throws MissingObjectException, IncorrectObjectTypeException, IOException 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.- 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.- Since:
- 5.6
-
areAllReachable(Collection, Stream)