public class DescribeCommand extends GitCommand<String>
repo
Modifier | Constructor and Description |
---|---|
protected |
DescribeCommand(Repository repo) |
Modifier and Type | Method and Description |
---|---|
String |
call()
Describes the specified commit.
|
DescribeCommand |
setLong(boolean longDesc)
Determine whether always to use the long format or not.
|
DescribeCommand |
setTarget(ObjectId target)
Sets the commit to be described.
|
DescribeCommand |
setTarget(String rev)
Sets the commit to be described.
|
checkCallable, getRepository, setCallable
protected DescribeCommand(Repository repo)
repo
- public DescribeCommand setTarget(ObjectId target) throws IOException
target
- A non-null object ID to be described.this
MissingObjectException
- the supplied commit does not exist.IncorrectObjectTypeException
- the supplied id is not a commit or an annotated tag.IOException
- a pack file or loose object could not be read.public DescribeCommand setTarget(String rev) throws IOException, RefNotFoundException
rev
- Commit ID, tag, branch, ref, etc.
See Repository.resolve(String)
for allowed syntax.this
IncorrectObjectTypeException
- the supplied id is not a commit or an annotated tag.RefNotFoundException
- the given rev didn't resolve to any object.IOException
- a pack file or loose object could not be read.public DescribeCommand setLong(boolean longDesc)
true
the long format is used even the commit matches a tag.longDesc
- true
if always the long format should be used.this
public String call() throws GitAPIException
call
in interface Callable<String>
call
in class GitCommand<String>
If none of the ancestors of the commit being described has any tags at all, then this method returns null, indicating that there's no way to describe this tag.
GitAPIException
- or subclass thereof when an error occursCopyright © 2015 Eclipse JGit Project. All rights reserved.