Search in sources :

Example 6 with CherryPickOp

use of org.locationtech.geogig.api.porcelain.CherryPickOp in project GeoGig by boundlessgeo.

the class CherryPickOpTest method testCherryPickDirtyIndex.

@Test
public void testCherryPickDirtyIndex() throws Exception {
    insertAndAdd(points1);
    geogig.command(CommitOp.class).setMessage("commit for " + idP1).call();
    // create branch1 and checkout
    geogig.command(BranchCreateOp.class).setAutoCheckout(true).setName("branch1").call();
    insertAndAdd(points2);
    RevCommit c1 = geogig.command(CommitOp.class).setMessage("commit for " + idP2).call();
    // checkout master and insert some features
    geogig.command(CheckoutOp.class).setSource("master").call();
    insertAndAdd(points3);
    CherryPickOp cherryPick = geogig.command(CherryPickOp.class);
    cherryPick.setCommit(Suppliers.ofInstance(c1.getId()));
    exception.expect(IllegalStateException.class);
    cherryPick.call();
}
Also used : CherryPickOp(org.locationtech.geogig.api.porcelain.CherryPickOp) BranchCreateOp(org.locationtech.geogig.api.porcelain.BranchCreateOp) RevCommit(org.locationtech.geogig.api.RevCommit) Test(org.junit.Test)

Example 7 with CherryPickOp

use of org.locationtech.geogig.api.porcelain.CherryPickOp in project GeoGig by boundlessgeo.

the class CherryPickOpTest method testCherryPickInvalidCommit.

@Test
public void testCherryPickInvalidCommit() throws Exception {
    CherryPickOp cherryPick = geogig.command(CherryPickOp.class);
    cherryPick.setCommit(Suppliers.ofInstance(ObjectId.NULL));
    exception.expect(IllegalArgumentException.class);
    cherryPick.call();
}
Also used : CherryPickOp(org.locationtech.geogig.api.porcelain.CherryPickOp) Test(org.junit.Test)

Aggregations

CherryPickOp (org.locationtech.geogig.api.porcelain.CherryPickOp)7 Test (org.junit.Test)6 RevCommit (org.locationtech.geogig.api.RevCommit)5 BranchCreateOp (org.locationtech.geogig.api.porcelain.BranchCreateOp)3 LogOp (org.locationtech.geogig.api.porcelain.LogOp)2 Ignore (org.junit.Ignore)1 GeoGIG (org.locationtech.geogig.api.GeoGIG)1 ObjectId (org.locationtech.geogig.api.ObjectId)1 RevParse (org.locationtech.geogig.api.plumbing.RevParse)1