protected @Override FetchOp fetchOp() throws RepositoryConnectionException { FetchOp fetchOp = super.fetchOp(); fetchOp.addListener(verifyFetchedIndexesListener); return fetchOp.setFetchIndexes(true); }
private Collection<RefDiff> fetchRemoteData(final Repository clone, Remote remote, final int depth, final boolean cloneIndexes) { // Fetch remote data final TransferSummary fetchResults; final ProgressListener progress = getProgressListener(); fetchResults = clone.command(FetchOp.class)// .addRemote(remote)// .setDepth(depth)// .setAutofetchTags(true)// .setFetchIndexes(cloneIndexes)// .setProgressListener(progress)// .call(); Map<String, Collection<RefDiff>> changedRefs = fetchResults.getRefDiffs(); String fetchURL = remote.getFetchURL(); Collection<RefDiff> refs = changedRefs.get(fetchURL); if (refs == null) { refs = ImmutableList.of(); } return refs; }
.setFetchIndexes(includeIndexes)//
fetch.setAll(all).setPrune(prune).setFullDepth(fulldepth); fetch.setDepth(depth); fetch.setFetchIndexes(withIndexes);
fetch.setAll(all).setPrune(prune).setFullDepth(fulldepth); fetch.setDepth(depth); fetch.setFetchIndexes(withIndexes);
command.getClientData().put(remote.getFetchURL(), repo1); command.setAllRemotes(true)// .setFetchIndexes(false)// NOT FETCHING INDEXES INITIALLY .call(); command.getClientData().put(remote.getFetchURL(), repo1); TransferSummary ts = command.setAllRemotes(true)// .setFetchIndexes(true)// BUT FETCHING AFTERWARDS, SHOULD GET THEM ALL .call(); verifyFetchedIndexes(command, ts);
private void fakeUpToDate() { Remote remote = request.buildRemote(); GeogigTransaction tx = request.getTransaction(origin.getRepo().context()); tx.command(FetchOp.class).setFetchIndexes(true).addRemote(remote).call(); Ref remoteBranchState = clone.getRef(request.getRemoteBranch()); Ref localRemoteBranchState = tx.command(RefParse.class).setName(request.getOriginRef()) .call().get(); assertEquals(remoteBranchState.getObjectId(), localRemoteBranchState.getObjectId()); } }
command.getClientData().put(remote.getFetchURL(), repo1); TransferSummary ts = command.setAllRemotes(true)// .setFetchIndexes(true)// FETCHING INDEXES FROM SCRATCH .call(); verifyFetchedIndexes(command, ts); command.getClientData().put(remote.getFetchURL(), repo1); ts = command.setAllRemotes(true)// .setFetchIndexes(true)// SHOULD KEEP WORKING AFTERWARDS .call(); verifyFetchedIndexes(command, ts);