Example usage for org.eclipse.jgit.api TagCommand setAnnotated

List of usage examples for org.eclipse.jgit.api TagCommand setAnnotated

Introduction

In this page you can find the example usage for org.eclipse.jgit.api TagCommand setAnnotated.

Prototype

public TagCommand setAnnotated(boolean annotated) 

Source Link

Document

Configure this tag to be created as an annotated tag

Usage

From source file:com.google.gerrit.acceptance.PushOneCommit.java

License:Apache License

private Result execute(String ref) throws Exception {
    RevCommit c = commitBuilder.create();
    if (changeId == null) {
        changeId = GitUtil.getChangeId(testRepo, c).get();
    }//from   ww  w  .  ja  va2s  . c  o  m
    if (tag != null) {
        TagCommand tagCommand = testRepo.git().tag().setName(tag.name);
        if (tag instanceof AnnotatedTag) {
            AnnotatedTag annotatedTag = (AnnotatedTag) tag;
            tagCommand.setAnnotated(true).setMessage(annotatedTag.message).setTagger(annotatedTag.tagger);
        } else {
            tagCommand.setAnnotated(false);
        }
        tagCommand.call();
    }
    return new Result(ref, pushHead(testRepo, ref, tag != null, force), c, subject);
}