Change change = changes.get(addedFile);
ContentRevision beforeRevision = null;
if (change.getType().equals(Change.Type.MODIFICATION)) {
ContentRevision changeBeforeRevision = change.getBeforeRevision();
assert changeBeforeRevision != null;
beforeRevision = new SimpleContentRevision(
changeBeforeRevision.getContent(),
changeBeforeRevision.getFile(),
baseHash);
}
diff.add(new Change(beforeRevision, change.getAfterRevision()));