Package org.eclipse.jgit.api
Class NameRevCommand
- java.lang.Object
-
- org.eclipse.jgit.api.GitCommand<Map<ObjectId,String>>
-
- org.eclipse.jgit.api.NameRevCommand
-
public class NameRevCommand extends GitCommand<Map<ObjectId,String>>
Command to find human-readable names of revisions.- Since:
- 3.0
- See Also:
- Git documentation about name-rev
-
-
Field Summary
-
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
NameRevCommand(Repository repo)
Create a new name-rev command.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NameRevCommand
add(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 underrefs/tags/
to the set that all results must match.NameRevCommand
addPrefix(String prefix)
Add a ref prefix to the set that results must match.NameRevCommand
addRef(Ref ref)
Add a ref to the set that all results must match.Map<ObjectId,String>
call()
-
Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
-
-
-
-
Constructor Detail
-
NameRevCommand
protected NameRevCommand(Repository repo)
Create a new name-rev command.- Parameters:
repo
- theRepository
-
-
Method Detail
-
call
public Map<ObjectId,String> call() throws GitAPIException
Execute the command
-
add
public NameRevCommand add(ObjectId id) throws MissingObjectException, JGitInternalException
Add an object to search for.- Parameters:
id
- object ID to add.- Returns:
this
- Throws:
MissingObjectException
- 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 callingThrowable.getCause()
.
-
add
public NameRevCommand add(Iterable<ObjectId> ids) throws MissingObjectException, JGitInternalException
Add multiple objects to search for.- Parameters:
ids
- object IDs to add.- Returns:
this
- Throws:
MissingObjectException
- 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 callingThrowable.getCause()
.
-
addPrefix
public NameRevCommand addPrefix(String prefix)
Add a ref prefix to the set that results must match.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 byaddPrefix(String)
.- Parameters:
prefix
- prefix to add; the prefix must end with a slash- Returns:
this
-
addAnnotatedTags
public NameRevCommand addAnnotatedTags()
Add all annotated tags underrefs/tags/
to the set that all results must match.Calls
addRef(Ref)
; see that method for a note on matching priority.- Returns:
this
- Throws:
JGitInternalException
- a low-level exception of JGit has occurred. The original exception can be retrieved by callingThrowable.getCause()
.
-
addRef
public NameRevCommand addRef(Ref ref)
Add a ref to the set that all results must match.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 byaddPrefix(String)
.- Parameters:
ref
- ref to add.- Returns:
this
-
-