@Test
public void ForceRenameTest() throws Exception {
insertAndAdd(points1);
geogig.command(AddOp.class).call();
geogig.command(CommitOp.class).call();
Ref TestBranch1 = geogig.command(BranchCreateOp.class).setName("TestBranch1").call();
geogig.command(BranchCreateOp.class).setName("TestBranch2").setAutoCheckout(true).call();
insertAndAdd(points2);
geogig.command(AddOp.class).call();
geogig.command(CommitOp.class).setMessage("this should be deleted").call();
geogig.command(CheckoutOp.class).setSource("TestBranch1").call();
Ref SuperTestBranch = geogig.command(BranchRenameOp.class).setNewName("TestBranch2")
.setForce(true).call();
Optional<Ref> result = geogig.command(RefParse.class).setName("TestBranch1").call();
assertFalse(result.isPresent());
result = geogig.command(RefParse.class).setName("TestBranch2").call();
assertTrue(result.isPresent());
assertEquals(TestBranch1.getObjectId(), SuperTestBranch.getObjectId());
exception.expect(IllegalStateException.class);
geogig.command(BranchRenameOp.class).setNewName("master").call();
}