public class TagCommand extends GitCommand<Ref>
Examples (git
is a Git
instance):
Create a new tag for the current commit:
git.tag().setName("v1.0").setMessage("First stable release").call();
Create a new unannotated tag for the current commit:
git.tag().setName("v1.0").setAnnotated(false).call();
repo
Modifier | Constructor and Description |
---|---|
protected |
TagCommand(Repository repo) |
Modifier and Type | Method and Description |
---|---|
Ref |
call()
Executes the
tag command with all the options and parameters
collected by the setter methods of this class. |
String |
getMessage() |
String |
getName() |
RevObject |
getObjectId() |
PersonIdent |
getTagger() |
boolean |
isAnnotated() |
boolean |
isForceUpdate() |
boolean |
isSigned() |
TagCommand |
setAnnotated(boolean annotated) |
TagCommand |
setForceUpdate(boolean forceUpdate)
If set to true the Tag command may replace an existing tag object.
|
TagCommand |
setMessage(String message) |
TagCommand |
setName(String name) |
TagCommand |
setObjectId(RevObject id)
Sets the object id of the tag.
|
TagCommand |
setSigned(boolean signed)
If set to true the Tag command creates a signed tag object.
|
TagCommand |
setTagger(PersonIdent tagger)
Sets the tagger of the tag.
|
checkCallable, getRepository, setCallable
protected TagCommand(Repository repo)
repo
- public Ref call() throws GitAPIException, ConcurrentRefUpdateException, InvalidTagNameException, NoHeadException
tag
command with all the options and parameters
collected by the setter methods of this class. Each instance of this
class should only be used for one invocation of the command (means: one
call to call()
)call
in interface Callable<Ref>
call
in class GitCommand<Ref>
Ref
a ref pointing to a tagNoHeadException
- when called on a git repo without a HEAD referenceGitAPIException
- or subclass thereof when an error occursConcurrentRefUpdateException
InvalidTagNameException
public TagCommand setName(String name)
name
- the tag name used for the tag
this
public String getName()
tag
public String getMessage()
tag
public TagCommand setMessage(String message)
message
- the tag message used for the tag
this
public boolean isSigned()
public TagCommand setSigned(boolean signed)
signed
- this
public TagCommand setTagger(PersonIdent tagger)
tagger
- this
public PersonIdent getTagger()
public RevObject getObjectId()
public TagCommand setObjectId(RevObject id)
id
- this
public boolean isForceUpdate()
public TagCommand setForceUpdate(boolean forceUpdate)
forceUpdate
- this
public TagCommand setAnnotated(boolean annotated)
annotated
- this
public boolean isAnnotated()
Copyright © 2015. All rights reserved.