use of org.locationtech.geogig.api.porcelain.CheckoutResult in project GeoGig by boundlessgeo.
the class CheckoutOpTest method testCheckoutPathFilterToUpdatePathThatIsntInIndex.
@Test
public void testCheckoutPathFilterToUpdatePathThatIsntInIndex() throws Exception {
insertAndAdd(points1);
geogig.command(CommitOp.class).setMessage("commit 1").call();
insertAndAdd(points2);
geogig.command(CommitOp.class).setMessage("commit 2").call();
insertAndAdd(points3);
geogig.command(CommitOp.class).setMessage("commit 3").call();
geogig.command(BranchCreateOp.class).setAutoCheckout(true).setName("branch1").call();
insertAndAdd(lines1);
geogig.command(CommitOp.class).setMessage("commit 4").call();
insertAndAdd(lines2);
geogig.command(CommitOp.class).setMessage("commit 5").call();
insertAndAdd(lines3);
geogig.command(CommitOp.class).setMessage("commit 6").call();
geogig.command(CheckoutOp.class).setSource("master").call();
CheckoutResult result = geogig.command(CheckoutOp.class).setSource("branch1").addPath("Lines/Lines.1").call();
Optional<RevTree> workTree = geogig.command(RevObjectParse.class).setObjectId(result.getNewTree()).call(RevTree.class);
Optional<NodeRef> nodeRef = geogig.command(FindTreeChild.class).setParent(workTree.get()).setChildPath("Points/Points.1").call();
assertTrue(nodeRef.isPresent());
nodeRef = geogig.command(FindTreeChild.class).setParent(workTree.get()).setChildPath("Points/Points.2").call();
assertTrue(nodeRef.isPresent());
nodeRef = geogig.command(FindTreeChild.class).setParent(workTree.get()).setChildPath("Points/Points.3").call();
assertTrue(nodeRef.isPresent());
nodeRef = geogig.command(FindTreeChild.class).setParent(workTree.get()).setChildPath("Lines/Lines.1").call();
assertTrue(nodeRef.isPresent());
nodeRef = geogig.command(FindTreeChild.class).setParent(workTree.get()).setChildPath("Lines/Lines.2").call();
assertFalse(nodeRef.isPresent());
nodeRef = geogig.command(FindTreeChild.class).setParent(workTree.get()).setChildPath("Lines/Lines.3").call();
assertFalse(nodeRef.isPresent());
}
Aggregations