public abstract class GitCommand extends Object
Optional
to represent a response. That response could be "a value" or "empty". So,
if you code returns nothing, just do "return Optional.empty".| Constructor and Description |
|---|
GitCommand() |
| Modifier and Type | Method and Description |
|---|---|
abstract <T> Optional<T> |
execute()
This method has to be implemented by subclasses to execute the git command.
|
protected org.eclipse.jgit.revwalk.RevCommit |
getRevCommit(org.eclipse.jgit.lib.ObjectId startCommitObjectId,
org.eclipse.jgit.revwalk.RevWalk revWalk)
Based on the start commit and the revWalk I return the a reference to a commit (RevCommit)
|
protected org.eclipse.jgit.revwalk.RevTree |
getRevTree(org.eclipse.jgit.revwalk.RevWalk revWalk,
org.eclipse.jgit.revwalk.RevCommit commit) |
protected org.eclipse.jgit.lib.ObjectId |
getStartCommit(org.eclipse.jgit.api.Git git,
String startCommitString)
Resolves the objectId of the start commit.
|
protected void |
isBare(org.eclipse.jgit.lib.Repository repository)
Check if the repository is bare, if not throws an
IllegalStateException |
public abstract <T> Optional<T> execute()
T - The type of the returning optional.protected org.eclipse.jgit.revwalk.RevTree getRevTree(org.eclipse.jgit.revwalk.RevWalk revWalk,
org.eclipse.jgit.revwalk.RevCommit commit)
protected org.eclipse.jgit.revwalk.RevCommit getRevCommit(org.eclipse.jgit.lib.ObjectId startCommitObjectId,
org.eclipse.jgit.revwalk.RevWalk revWalk)
startCommitObjectId - the objectId to search the revision commit.revWalk - the object that walks into the commit graph.protected void isBare(org.eclipse.jgit.lib.Repository repository)
IllegalStateExceptionrepository - Git Repository you need to checkprotected org.eclipse.jgit.lib.ObjectId getStartCommit(org.eclipse.jgit.api.Git git,
String startCommitString)
git - the repository that contain the commit.startCommitString - a String with the id of the commit.Copyright © 2012–2017 JBoss by Red Hat. All rights reserved.