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;
}
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;
}
Aggregations