Tag tag = tags.get(i);
if (this.commitsSize == 0) {
children.put(tag.toJSON());
} else {
// add info about commits if requested
LogCommand lc = git.log();
String toCommitName = tag.getRevCommitName();
ObjectId toCommitId = db.resolve(toCommitName);
Ref toCommitRef = db.getRef(toCommitName);
toCommitId = getCommitObjectId(db, toCommitId);
lc.add(toCommitId);
lc.setMaxCount(this.commitsSize);
Iterable<RevCommit> commits = lc.call();
Log log = new Log(cloneLocation, db, commits, null, null, toCommitRef);
log.setPaging(1, commitsSize);
children.put(tag.toJSON(log.toJSON()));
}
}