/** * Apply provided remote configuration on this transport. * * @param cfg * configuration to apply on this transport. */ public void applyConfig(RemoteConfig cfg) { setOptionUploadPack(cfg.getUploadPack()); setOptionReceivePack(cfg.getReceivePack()); setTagOpt(cfg.getTagOpt()); fetch = cfg.getFetchRefSpecs(); push = cfg.getPushRefSpecs(); timeout = cfg.getTimeout(); }
transport.setDryRun(dryRun); if (tagOption != null) transport.setTagOpt(tagOption); transport.setFetchThin(thin); configure(transport);
private Collection<Ref> fetch(final Repository repository, final RemoteConfig remoteConfig, final CharSequence repoBranch) { try (Transport transport = Transport.open(repository, remoteConfig)) { configure(transport); transport.setCheckFetchedObjects(false); transport.setRemoveDeletedRefs(false); transport.setDryRun(false); transport.setTagOpt(TagOpt.FETCH_TAGS); transport.setFetchThin(false); final ProgressMonitor monitor = new EmptyProgressMonitor() { }; FetchResult result = transport.fetch(monitor, Arrays.asList( new RefSpec("refs/heads/" + repoBranch) )); logger.debug(String.format("Fetched %s: %s", result.getURI(), result.getMessages())); result.getAdvertisedRefs().stream().forEach(ref -> { logger.debug(String.format("Remote Ref: %s = %s", ref.getName(), ref.getObjectId())); }); return result.getAdvertisedRefs(); } catch (Throwable e) { throw new RuntimeException(e); } }
private FetchResult runFetch() throws URISyntaxException, IOException { final Transport tn = Transport.open(db, remoteName); final FetchResult r; try { tn.setTagOpt(TagOpt.FETCH_TAGS); r = tn.fetch(new TextProgressMonitor(), null); } finally { tn.close(); } showFetchResult(r); return r; }
/** * Apply provided remote configuration on this transport. * * @param cfg * configuration to apply on this transport. */ public void applyConfig(final RemoteConfig cfg) { setOptionUploadPack(cfg.getUploadPack()); setOptionReceivePack(cfg.getReceivePack()); setTagOpt(cfg.getTagOpt()); fetch = cfg.getFetchRefSpecs(); push = cfg.getPushRefSpecs(); timeout = cfg.getTimeout(); }
/** * Apply provided remote configuration on this transport. * * @param cfg * configuration to apply on this transport. */ public void applyConfig(RemoteConfig cfg) { setOptionUploadPack(cfg.getUploadPack()); setOptionReceivePack(cfg.getReceivePack()); setTagOpt(cfg.getTagOpt()); fetch = cfg.getFetchRefSpecs(); push = cfg.getPushRefSpecs(); timeout = cfg.getTimeout(); }
transport.setDryRun(dryRun); if (tagOption != null) transport.setTagOpt(tagOption); transport.setFetchThin(thin); configure(transport);
transport.setDryRun(dryRun); if (tagOption != null) transport.setTagOpt(tagOption); transport.setFetchThin(thin); configure(transport);