Search in sources :

Example 1 with SendPack

use of org.locationtech.geogig.api.plumbing.SendPack in project GeoGig by boundlessgeo.

the class RemoteRepositoryTestCase method push.

protected PushOp push() {
    SendPack sendPack = spy(localGeogig.geogig.command(SendPack.class));
    doReturn(Optional.of(remoteRepo)).when(sendPack).getRemoteRepo(any(Remote.class));
    PushOp push = spy(localGeogig.geogig.command(PushOp.class));
    doReturn(sendPack).when(push).command(eq(SendPack.class));
    FetchOp fetch = fetch();
    // when(push.command(FetchOp.class)).thenReturn(fetch);
    doReturn(fetch).when(push).command(eq(FetchOp.class));
    LsRemote lsRemote = lsremote();
    // when(push.command(LsRemote.class)).thenReturn(lsRemote);
    doReturn(lsRemote).when(push).command(eq(LsRemote.class));
    return push;
}
Also used : PushOp(org.locationtech.geogig.api.porcelain.PushOp) SendPack(org.locationtech.geogig.api.plumbing.SendPack) FetchOp(org.locationtech.geogig.api.porcelain.FetchOp) LsRemote(org.locationtech.geogig.api.plumbing.LsRemote) Remote(org.locationtech.geogig.api.Remote) LsRemote(org.locationtech.geogig.api.plumbing.LsRemote)

Example 2 with SendPack

use of org.locationtech.geogig.api.plumbing.SendPack in project GeoGig by boundlessgeo.

the class PushOp method _call.

/**
     * Executes the push operation.
     * 
     * @return {@code null}
     * @see org.locationtech.geogig.api.AbstractGeoGigOp#call()
     */
@Override
protected TransferSummary _call() {
    final String remoteName = this.remoteName == null ? "origin" : this.remoteName;
    final Remote remote = resolveRemote(remoteName);
    final List<TransferableRef> refsToPush = resolveRefs();
    SendPack sendPack = command(SendPack.class);
    sendPack.setRemote(remote);
    sendPack.setRefs(refsToPush);
    sendPack.setProgressListener(getProgressListener());
    TransferSummary result = sendPack.call();
    return result;
}
Also used : SendPack(org.locationtech.geogig.api.plumbing.SendPack) TransferableRef(org.locationtech.geogig.api.plumbing.SendPack.TransferableRef) Remote(org.locationtech.geogig.api.Remote)

Aggregations

Remote (org.locationtech.geogig.api.Remote)2 SendPack (org.locationtech.geogig.api.plumbing.SendPack)2 LsRemote (org.locationtech.geogig.api.plumbing.LsRemote)1 TransferableRef (org.locationtech.geogig.api.plumbing.SendPack.TransferableRef)1 FetchOp (org.locationtech.geogig.api.porcelain.FetchOp)1 PushOp (org.locationtech.geogig.api.porcelain.PushOp)1