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)
Constructor for TagCommand.
|
Modifier and Type | Method and Description |
---|---|
Ref |
call() |
String |
getMessage()
Get the tag
message . |
String |
getName()
Get the tag
name . |
RevObject |
getObjectId()
Get the tag's object id
|
PersonIdent |
getTagger()
Get the
tagger who created the tag. |
boolean |
isAnnotated()
Whether this will create an annotated command
|
boolean |
isForceUpdate()
Whether this is a forced update
|
boolean |
isSigned()
Whether this tag is signed
|
TagCommand |
setAnnotated(boolean annotated)
Configure this tag to be created as an annotated tag
|
TagCommand |
setForceUpdate(boolean forceUpdate)
If set to true the Tag command may replace an existing tag object.
|
TagCommand |
setMessage(String message)
Set the tag
message . |
TagCommand |
setName(String name)
Set the tag
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)
Constructor for TagCommand.
repo
- a Repository
object.public Ref call() throws GitAPIException, ConcurrentRefUpdateException, InvalidTagNameException, NoHeadException
Execute the command
Executes the 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>
GitAPIException
ConcurrentRefUpdateException
InvalidTagNameException
NoHeadException
public TagCommand setName(String name)
name
.name
- the tag name used for the tag
this
public String getName()
name
.tag
public String getMessage()
message
.tag
public TagCommand setMessage(String message)
message
.message
- the tag message used for the tag
this
public boolean isSigned()
public TagCommand setSigned(boolean signed)
signed
- a boolean.this
public TagCommand setTagger(PersonIdent tagger)
tagger
- a PersonIdent
object.this
public PersonIdent getTagger()
tagger
who created the tag.public RevObject getObjectId()
public TagCommand setObjectId(RevObject id)
id
- a RevObject
object.this
public boolean isForceUpdate()
public TagCommand setForceUpdate(boolean forceUpdate)
forceUpdate
- whether this is a forced updatethis
public TagCommand setAnnotated(boolean annotated)
annotated
- whether this shall be an annotated tagthis
public boolean isAnnotated()
Copyright © 2019 Eclipse JGit Project. All rights reserved.