insertAndAdd(lines1);
final RevCommit c3 = geogig.command(CommitOp.class).setMessage("commit for " + idL2).call();
final Ref branch3 = geogig.command(BranchCreateOp.class).setName("branch3").call();
CheckoutResult result;
result = geogig.command(CheckoutOp.class).setSource("branch1").call();
assertEquals(c1.getTreeId(), result.getNewTree());
assertTrue(geogig.command(RefParse.class).setName(Ref.HEAD).call().get() instanceof SymRef);
assertEquals(branch1.getName(), ((SymRef) geogig.command(RefParse.class).setName(Ref.HEAD)
.call().get()).getTarget());
result = geogig.command(CheckoutOp.class).setSource("branch2").call();
assertEquals(c2.getTreeId(), result.getNewTree());
assertTrue(geogig.command(RefParse.class).setName(Ref.HEAD).call().get() instanceof SymRef);
assertEquals(branch2.getName(), ((SymRef) geogig.command(RefParse.class).setName(Ref.HEAD)
.call().get()).getTarget());
result = geogig.command(CheckoutOp.class).setSource("branch3").call();
assertEquals(c3.getTreeId(), result.getNewTree());
assertTrue(geogig.command(RefParse.class).setName(Ref.HEAD).call().get() instanceof SymRef);
assertEquals(branch3.getName(), ((SymRef) geogig.command(RefParse.class).setName(Ref.HEAD)
.call().get()).getTarget());
}