}
@Test
public void testFilterMatchesSingleBlobChange() throws Exception {
final ObjectId initialOid = insertAndAdd(points1);
final RevCommit commit1 = geogig.command(CommitOp.class).setAll(true).call();
insertAndAdd(lines1);
final RevCommit commit2 = geogig.command(CommitOp.class).setAll(true).call();
((SimpleFeature) points1).setAttribute("sp", "modified");
final ObjectId modifiedOid = insertAndAdd(points1);
final RevCommit commit3 = geogig.command(CommitOp.class).setAll(true).call();
diffOp.setOldVersion(commit1.getId()).setNewVersion(commit3.getId());
diffOp.setFilter(NodeRef.appendChild(pointsName, points1.getIdentifier().getID()));
List<DiffEntry> diffs;
DiffEntry diff;
diffs = toList(diffOp.call());
assertEquals(1, diffs.size());
diff = diffs.get(0);
assertEquals(ChangeType.MODIFIED, diff.changeType());
assertEquals(initialOid, diff.oldObjectId());
assertEquals(modifiedOid, diff.newObjectId());
assertTrue(deleteAndAdd(points1));
final RevCommit commit4 = geogig.command(CommitOp.class).setAll(true).call();
diffOp.setOldVersion(commit2.getId()).setNewVersion(commit4.getId());
diffOp.setFilter(NodeRef.appendChild(pointsName, points1.getIdentifier().getID()));
diffs = toList(diffOp.call());
assertEquals(1, diffs.size());
diff = diffs.get(0);
assertEquals(ChangeType.REMOVED, diff.changeType());
assertEquals(initialOid, diff.oldObjectId());
assertEquals(ObjectId.NULL, diff.newObjectId());
// invert the order of old and new commit
diffOp.setOldVersion(commit4.getId()).setNewVersion(commit1.getId());
diffOp.setFilter(NodeRef.appendChild(pointsName, points1.getIdentifier().getID()));
diffs = toList(diffOp.call());
assertEquals(1, diffs.size());
diff = diffs.get(0);
assertEquals(ChangeType.ADDED, diff.changeType());
assertEquals(ObjectId.NULL, diff.oldObjectId());
assertEquals(initialOid, diff.newObjectId());
// different commit range
diffOp.setOldVersion(commit4.getId()).setNewVersion(commit3.getId());
diffOp.setFilter(NodeRef.appendChild(pointsName, points1.getIdentifier().getID()));
diffs = toList(diffOp.call());
assertEquals(1, diffs.size());
diff = diffs.get(0);
assertEquals(ChangeType.ADDED, diff.changeType());