protected DiffEntry computeNext() {
if (source.hasNext()) {
DiffEntry next = source.next();
if (next.getNewObject() != null) {
NodeRef newObject = next.getNewObject();
RevObject object = sourceRepo.command(RevObjectParse.class)
.setObjectId(newObject.getNode().getObjectId()).call().get();
RevObject metadata = null;
if (newObject.getMetadataId() != ObjectId.NULL) {
metadata = sourceRepo.command(RevObjectParse.class)
.setObjectId(newObject.getMetadataId()).call().get();
}
if (!destinationRepo.blobExists(object.getId())) {
destinationRepo.objectDatabase().put(object);
}
if (metadata != null && !destinationRepo.blobExists(metadata.getId())) {
destinationRepo.objectDatabase().put(metadata);
}
}
return next;
}