public class NameRevCommand extends GitCommand<java.util.Map<ObjectId,java.lang.String>>
| Modifier and Type | Class and Description |
|---|---|
private static class |
NameRevCommand.NameRevCommit |
| Modifier and Type | Field and Description |
|---|---|
private static int |
COMMIT_TIME_SLOP
Amount of slop to allow walking past the earliest requested commit.
|
private static int |
MERGE_COST
Cost of traversing a merge commit compared to a linear history.
|
private int |
mergeCost |
private java.util.List<java.lang.String> |
prefixes |
private java.util.List<Ref> |
refs |
private java.util.List<ObjectId> |
revs |
private RevWalk |
walk |
repo| Modifier | Constructor and Description |
|---|---|
protected |
NameRevCommand(Repository repo)
Create a new name-rev command.
|
| Modifier and Type | Method and Description |
|---|---|
NameRevCommand |
add(java.lang.Iterable<ObjectId> ids)
Add multiple objects to search for.
|
NameRevCommand |
add(ObjectId id)
Add an object to search for.
|
NameRevCommand |
addAnnotatedTags()
Add all annotated tags under
refs/tags/ to the set that all
results must match. |
NameRevCommand |
addPrefix(java.lang.String prefix)
Add a ref prefix to the set that results must match.
|
private void |
addPrefix(java.lang.String prefix,
java.util.Map<ObjectId,java.lang.String> nonCommits,
FIFORevQueue pending) |
private void |
addPrefixes(java.util.Map<ObjectId,java.lang.String> nonCommits,
FIFORevQueue pending) |
NameRevCommand |
addRef(Ref ref)
Add a ref to the set that all results must match.
|
private void |
addRef(Ref ref,
java.util.Map<ObjectId,java.lang.String> nonCommits,
FIFORevQueue pending) |
java.util.Map<ObjectId,java.lang.String> |
call() |
private long |
compare(java.lang.String leftTip,
long leftCost,
java.lang.String rightTip,
long rightCost) |
private int |
minCommitTime() |
(package private) NameRevCommand |
setMergeCost(int cost) |
private static java.lang.String |
simplify(java.lang.String refName) |
checkCallable, getRepository, setCallableprivate static final int COMMIT_TIME_SLOP
private static final int MERGE_COST
private final RevWalk walk
private final java.util.List<java.lang.String> prefixes
private final java.util.List<ObjectId> revs
private java.util.List<Ref> refs
private int mergeCost
protected NameRevCommand(Repository repo)
repo - the Repositorypublic java.util.Map<ObjectId,java.lang.String> call() throws GitAPIException
Execute the command
call in interface java.util.concurrent.Callable<java.util.Map<ObjectId,java.lang.String>>call in class GitCommand<java.util.Map<ObjectId,java.lang.String>>GitAPIExceptionpublic NameRevCommand add(ObjectId id) throws MissingObjectException, JGitInternalException
id - object ID to add.thisMissingObjectException - the object supplied is not available from the object
database.JGitInternalException - a low-level exception of JGit has occurred. The original
exception can be retrieved by calling
Throwable.getCause().public NameRevCommand add(java.lang.Iterable<ObjectId> ids) throws MissingObjectException, JGitInternalException
ids - object IDs to add.thisMissingObjectException - the object supplied is not available from the object
database.JGitInternalException - a low-level exception of JGit has occurred. The original
exception can be retrieved by calling
Throwable.getCause().public NameRevCommand addPrefix(java.lang.String prefix)
If an object matches multiple refs equally well, the first matching ref
added with addRef(Ref) is preferred, or else the first matching
prefix added by addPrefix(String).
prefix - prefix to add; see
RefDatabase.getRefs(String)thispublic NameRevCommand addAnnotatedTags()
refs/tags/ to the set that all
results must match.
Calls addRef(Ref); see that method for a note on matching
priority.
thisJGitInternalException - a low-level exception of JGit has occurred. The original
exception can be retrieved by calling
Throwable.getCause().public NameRevCommand addRef(Ref ref)
If an object matches multiple refs equally well, the first matching ref
added with addRef(Ref) is preferred, or else the first matching
prefix added by addPrefix(String).
ref - ref to add.thisNameRevCommand setMergeCost(int cost)
private void addPrefixes(java.util.Map<ObjectId,java.lang.String> nonCommits, FIFORevQueue pending) throws java.io.IOException
java.io.IOExceptionprivate void addPrefix(java.lang.String prefix,
java.util.Map<ObjectId,java.lang.String> nonCommits,
FIFORevQueue pending)
throws java.io.IOException
java.io.IOExceptionprivate void addRef(Ref ref, java.util.Map<ObjectId,java.lang.String> nonCommits, FIFORevQueue pending) throws java.io.IOException
java.io.IOExceptionprivate int minCommitTime()
throws java.io.IOException
java.io.IOExceptionprivate long compare(java.lang.String leftTip,
long leftCost,
java.lang.String rightTip,
long rightCost)
private static java.lang.String simplify(java.lang.String refName)