Example usage for org.eclipse.jgit.api NameRevCommand addAnnotatedTags

List of usage examples for org.eclipse.jgit.api NameRevCommand addAnnotatedTags

Introduction

In this page you can find the example usage for org.eclipse.jgit.api NameRevCommand addAnnotatedTags.

Prototype

public NameRevCommand addAnnotatedTags() 

Source Link

Document

Add all annotated tags under refs/tags/ to the set that all results must match.

Usage

From source file:com.google.gitiles.DescribeServlet.java

License:Open Source License

private NameRevCommand nameRevCommand(ObjectId id, HttpServletRequest req, HttpServletResponse res)
        throws IOException {
    Repository repo = ServletUtils.getRepository(req);
    GitilesView view = ViewFilter.getView(req);
    NameRevCommand cmd = new Git(repo).nameRev();
    boolean all = getBooleanParam(view, ALL_PARAM);
    boolean tags = getBooleanParam(view, TAGS_PARAM);
    if (all && tags) {
        renderTextError(req, res, SC_BAD_REQUEST, "Cannot specify both \"all\" and \"tags\"");
        return null;
    }/*from www.  ja v a2s . com*/
    if (all) {
        cmd.addPrefix(Constants.R_REFS);
    } else if (tags) {
        cmd.addPrefix(Constants.R_TAGS);
    } else {
        cmd.addAnnotatedTags();
    }
    cmd.add(id);
    return cmd;
}