@Test public void testFetchSpecificRemoteAndAll() throws Exception { // fetch from the remote FetchOp fetch = fetchOp(); TransferSummary summary = fetch.addRemote("upstream").setAllRemotes(true).call(); assertEquals(2, summary.getRefDiffs().size()); assertTrue(summary.getRefDiffs().containsKey(origin.getFetchURL())); assertTrue(summary.getRefDiffs().containsKey(upstream.getFetchURL())); assertSummary(summary, origin.getFetchURL(), localOriginMaster, originMaster); assertSummary(summary, origin.getFetchURL(), absent(), originBranch1); assertSummary(summary, origin.getFetchURL(), absent(), originTag); assertSummary(summary, upstream.getFetchURL(), absent(), upstreamMaster); assertSummary(summary, upstream.getFetchURL(), absent(), upstreamBranch1); verifyFetch(); }
command.setAllRemotes(true)// .setFetchIndexes(false)// NOT FETCHING INDEXES INITIALLY .call(); TransferSummary ts = command.setAllRemotes(true)// .setFetchIndexes(true)// BUT FETCHING AFTERWARDS, SHOULD GET THEM ALL .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(); }
fetch.addRemote("origin").setAllRemotes(true).call();
TransferSummary ts = command.setAllRemotes(true)// .setFetchIndexes(true)// FETCHING INDEXES FROM SCRATCH .call(); ts = command.setAllRemotes(true)// .setFetchIndexes(true)// SHOULD KEEP WORKING AFTERWARDS .call();