List of usage examples for org.eclipse.jgit.api NameRevCommand add
public NameRevCommand add(Iterable<ObjectId> ids) throws MissingObjectException, JGitInternalException
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; }/* ww w. j a v a2s . c o m*/ if (all) { cmd.addPrefix(Constants.R_REFS); } else if (tags) { cmd.addPrefix(Constants.R_TAGS); } else { cmd.addAnnotatedTags(); } cmd.add(id); return cmd; }