RevWalk walk = new RevWalk(db);
try {
String tagName = toPut.getString(ProtocolConstants.KEY_NAME);
String commitId = toPut.getString(GitConstants.KEY_TAG_COMMIT);
ObjectId objectId = db.resolve(commitId);
RevCommit revCommit = walk.lookupCommit(objectId);
Ref ref = tag(git, revCommit, tagName);
URI cloneLocation = BaseToCloneConverter.getCloneLocation(getURI(request), BaseToCloneConverter.TAG_LIST);
Tag tag = new Tag(cloneLocation, db, ref);
OrionServlet.writeJSONResponse(request, response, tag.toJSON(), JsonURIUnqualificationStrategy.ALL_NO_GIT);