public TestData branchDelete(String branch) { Optional<? extends Ref> ref = getContext().command(BranchDeleteOp.class).setName(branch) .call(); checkState(ref.isPresent()); return this; }
@Test public void BranchNotPresentTest() { Optional<? extends Ref> branchref = geogig.command(BranchDeleteOp.class).setName("noBranch") .call(); assertEquals(Optional.absent(), branchref); }
@Test public void BranchNotPresentTest() { Optional<? extends Ref> branchref = geogig.command(BranchDeleteOp.class).setName("noBranch") .call(); assertEquals(Optional.absent(), branchref); }
deletedBranch = geogig.command(BranchDeleteOp.class).setName(br).call();
deletedBranch = geogig.command(BranchDeleteOp.class).setName(br).call();
deletedBranch = geogig.command(BranchDeleteOp.class).setName(br).call();
@Test public void NoBranchNameTest() { BranchDeleteOp testOp = new BranchDeleteOp(); testOp.setName(null); exception.expect(IllegalStateException.class); testOp.call(); }
@Test public void NoBranchNameTest() { BranchDeleteOp testOp = new BranchDeleteOp(); testOp.setName(null); exception.expect(IllegalStateException.class); testOp.call(); }
@Test public void testFetchWithPrune() throws Exception { // fetch from the remote FetchOp fetch = fetchOp(); fetch.addRemote("origin").setAllRemotes(true).call(); verifyFetch(); Optional<Ref> localOriginBranch1 = getRef(localRepo, "refs/remotes/origin/Branch1"); assertTrue(localOriginBranch1.isPresent()); // Remove a branch from the remote remoteGeogig.geogig.command(BranchDeleteOp.class).setName("Branch1").call(); // fetch again fetch = fetchOp(); TransferSummary summary = fetch.setPrune(true).call(); assertSummary(summary, origin.getFetchURL(), localOriginBranch1, absent()); verifyPrune(); }
@Test public void testFetchWithPrune() throws Exception { // fetch from the remote FetchOp fetch = fetchOp(); fetch.addRemote("origin").setAll(true).call(); verifyFetch(); Optional<Ref> localOriginBranch1 = getRef(localRepo, "refs/remotes/origin/Branch1"); assertTrue(localOriginBranch1.isPresent()); // Remove a branch from the remote remoteGeogig.geogig.command(BranchDeleteOp.class).setName("Branch1").call(); // fetch again fetch = fetchOp(); TransferSummary summary = fetch.setPrune(true).call(); assertSummary(summary, origin.getFetchURL(), localOriginBranch1, absent()); verifyPrune(); }
@Test public void BranchPresentTest() throws Exception { insertAndAdd(points1); geogig.command(AddOp.class).call(); geogig.command(CommitOp.class).call(); geogig.command(BranchCreateOp.class).setName("TestBranch").call(); geogig.command(BranchDeleteOp.class).setName("TestBranch").call(); Optional<Ref> result = geogig.command(RefParse.class).setName("TestBranch").call(); assertFalse(result.isPresent()); }
@Test public void BranchPresentTest() throws Exception { insertAndAdd(points1); geogig.command(AddOp.class).call(); geogig.command(CommitOp.class).call(); geogig.command(BranchCreateOp.class).setName("TestBranch").call(); geogig.command(BranchDeleteOp.class).setName("TestBranch").call(); Optional<Ref> result = geogig.command(RefParse.class).setName("TestBranch").call(); assertFalse(result.isPresent()); }
assertEquals("master", checkout(tx1, "master").getNewRef().localName()); Optional<? extends Ref> b1deleted = tx1.command(BranchDeleteOp.class).setName("branch1") .call(); assertTrue(b1deleted.isPresent()); assertTrue(refParse(tx2, "branch2").isPresent()); Optional<? extends Ref> b2deleted = tx2.command(BranchDeleteOp.class).setName("branch2") .call(); assertTrue(b2deleted.isPresent());
@Test public void InvalidBranchNameTest() throws Exception { insertAndAdd(points1); geogig.command(AddOp.class).call(); geogig.command(CommitOp.class).call(); Ref testBranch = geogig.command(BranchCreateOp.class).setName("TestBranch").call(); testBranch = geogig.command(UpdateRef.class).setName("TestBranch") .setNewValue(testBranch.getObjectId()).call().get(); exception.expect(IllegalArgumentException.class); geogig.command(BranchDeleteOp.class).setName("TestBranch").call(); }
@Test public void InvalidBranchNameTest() throws Exception { insertAndAdd(points1); geogig.command(AddOp.class).call(); geogig.command(CommitOp.class).call(); Ref testBranch = geogig.command(BranchCreateOp.class).setName("TestBranch").call(); testBranch = geogig.command(UpdateRef.class).setName("TestBranch") .setNewValue(testBranch.getObjectId()).call().get(); exception.expect(IllegalArgumentException.class); geogig.command(BranchDeleteOp.class).setName("TestBranch").call(); } }
remoteGeogig.geogig.command(BranchDeleteOp.class).setName("Branch1").call();
remoteGeogig.geogig.command(BranchDeleteOp.class).setName("Branch1").call();
repo1.command(BranchDeleteOp.class).setName("branch2").call();
@Test public void BranchIsHeadTest() throws Exception { insertAndAdd(points1); geogig.command(AddOp.class).call(); geogig.command(CommitOp.class).call(); geogig.command(BranchCreateOp.class).setName("TestMasterBranch").call(); geogig.command(BranchCreateOp.class).setName("TestBranch").call(); geogig.command(CheckoutOp.class).setSource("TestBranch").call(); insertAndAdd(points2); geogig.command(AddOp.class).call(); geogig.command(CommitOp.class).call(); exception.expect(IllegalArgumentException.class); geogig.command(BranchDeleteOp.class).setName("TestBranch").call(); }
@Test public void BranchIsHeadTest() throws Exception { insertAndAdd(points1); geogig.command(AddOp.class).call(); geogig.command(CommitOp.class).call(); geogig.command(BranchCreateOp.class).setName("TestMasterBranch").call(); geogig.command(BranchCreateOp.class).setName("TestBranch").call(); geogig.command(CheckoutOp.class).setSource("TestBranch").call(); insertAndAdd(points2); geogig.command(AddOp.class).call(); geogig.command(CommitOp.class).call(); exception.expect(IllegalArgumentException.class); geogig.command(BranchDeleteOp.class).setName("TestBranch").call(); }