Map<String, ObjectId> parentMetadataIds = Maps.newHashMap();
Set<String> removedTrees = Sets.newHashSet();
StagingDatabase database = getDatabase();
while (unstaged.hasNext()) {
final DiffEntry diff = unstaged.next();
final String fullPath = diff.oldPath() == null ? diff.newPath() : diff.oldPath();
final String parentPath = NodeRef.parentPath(fullPath);
/*
* TODO: revisit, ideally the list of diff entries would come with one single entry for
* the whole removed tree instead of that one and every single children of it.
*/