// make a commit
insertAndAdd(points1);
RevCommit mainCommit = geogig.command(CommitOp.class).setMessage("Commit1").call();
// start the first transaction
GeogigTransaction transaction1 = geogig.command(TransactionBegin.class).call();
// make a new branch
transaction1.command(BranchCreateOp.class).setAutoCheckout(true).setName("branch1").call();
// perform a commit in the transaction
insertAndAdd(transaction1, points2);
RevCommit transaction1Commit = transaction1.command(CommitOp.class).setMessage("Commit2")
.call();
// Verify that the base repository is unchanged
Iterator<RevCommit> logs = geogig.command(LogOp.class).call();
assertEquals(logs.next(), mainCommit);
assertFalse(logs.hasNext());
// Verify that the transaction has the commit
logs = transaction1.command(LogOp.class).call();
assertEquals(logs.next(), transaction1Commit);
assertEquals(logs.next(), mainCommit);
assertFalse(logs.hasNext());
// start the second transaction
GeogigTransaction transaction2 = geogig.command(TransactionBegin.class).call();
// make a new branch
transaction2.command(BranchCreateOp.class).setAutoCheckout(true).setName("branch1").call();
// perform a commit in the transaction
insertAndAdd(transaction2, points3);
RevCommit transaction2Commit = transaction2.command(CommitOp.class).setMessage("Commit3")
.call();
// Verify that the base repository is unchanged
logs = geogig.command(LogOp.class).call();
assertEquals(logs.next(), mainCommit);
assertFalse(logs.hasNext());
// Verify that the transaction has the commit
logs = transaction2.command(LogOp.class).call();
assertEquals(logs.next(), transaction2Commit);
assertEquals(logs.next(), mainCommit);
assertFalse(logs.hasNext());
// Commit the first transaction