Log log = null;
// single commit is requested and we already know it, no need for LogCommand
if (commitsSize == 1 && toObjectId instanceof RevCommit) {
log = new Log(cloneLocation, db, Collections.singleton((RevCommit) toObjectId), null, null, toRefId);
} else {
LogCommand lc = git.log();
// set the commit range
lc.add(toObjectId);
lc.setMaxCount(this.commitsSize);
Iterable<RevCommit> commits = lc.call();
log = new Log(cloneLocation, db, commits, null, null, toRefId);