/** {@inheritDoc} */ @Override protected void blockingFetch(Repository repo, ReplicaFetchRequest req) throws NotSupportedException, TransportException { try (Transport transport = Transport.open(repo, uri)) { RemoteConfig rc = getRemoteConfig(); if (rc != null) { transport.applyConfig(rc); } fetch(transport, req); } }
/** * Open new transport instances to connect two repositories. * * @param local * existing local repository. * @param cfg * configuration describing how to connect to the remote * repository. * @param op * planned use of the returned Transport; the URI may differ * based on the type of connection desired. * @return the list of new transport instances for every URI in remote * configuration. * @throws org.eclipse.jgit.errors.NotSupportedException * the protocol specified is not supported. * @throws org.eclipse.jgit.errors.TransportException * the transport cannot open this URI. */ public static List<Transport> openAll(final Repository local, final RemoteConfig cfg, final Operation op) throws NotSupportedException, TransportException { final List<URIish> uris = getURIs(cfg, op); final List<Transport> transports = new ArrayList<>(uris.size()); for (URIish uri : uris) { final Transport tn = open(local, uri, cfg.getName()); tn.applyConfig(cfg); transports.add(tn); } return transports; }
JGitText.get().remoteConfigHasNoURIAssociated, cfg.getName())); final Transport tn = open(local, uris.get(0), cfg.getName()); tn.applyConfig(cfg); return tn;
private void push(Repository repo, ReplicaPushRequest req) throws NotSupportedException, TransportException, IOException { Map<String, Ref> adv; List<RemoteCommand> cmds = asUpdateList(req.getCommands()); try (Transport transport = Transport.open(repo, uri)) { RemoteConfig rc = getRemoteConfig(); if (rc != null) { transport.applyConfig(rc); } transport.setPushAtomic(true); adv = push(repo, transport, cmds); } for (RemoteCommand c : cmds) { c.copyStatusToResult(); } req.setRefs(adv); }
protected void blockingFetch(Repository repo, ReplicaFetchRequest req) throws NotSupportedException, TransportException { try (Transport transport = Transport.open(repo, uri)) { RemoteConfig rc = getRemoteConfig(); if (rc != null) { transport.applyConfig(rc); } fetch(transport, req); } }
/** * Open new transport instances to connect two repositories. * * @param local * existing local repository. * @param cfg * configuration describing how to connect to the remote * repository. * @param op * planned use of the returned Transport; the URI may differ * based on the type of connection desired. * @return the list of new transport instances for every URI in remote * configuration. * @throws NotSupportedException * the protocol specified is not supported. * @throws TransportException * the transport cannot open this URI. */ public static List<Transport> openAll(final Repository local, final RemoteConfig cfg, final Operation op) throws NotSupportedException, TransportException { final List<URIish> uris = getURIs(cfg, op); final List<Transport> transports = new ArrayList<Transport>(uris.size()); for (final URIish uri : uris) { final Transport tn = open(local, uri, cfg.getName()); tn.applyConfig(cfg); transports.add(tn); } return transports; }
/** {@inheritDoc} */ @Override protected void blockingFetch(Repository repo, ReplicaFetchRequest req) throws NotSupportedException, TransportException { try (Transport transport = Transport.open(repo, uri)) { RemoteConfig rc = getRemoteConfig(); if (rc != null) { transport.applyConfig(rc); } fetch(transport, req); } }
/** * Open new transport instances to connect two repositories. * * @param local * existing local repository. * @param cfg * configuration describing how to connect to the remote * repository. * @param op * planned use of the returned Transport; the URI may differ * based on the type of connection desired. * @return the list of new transport instances for every URI in remote * configuration. * @throws org.eclipse.jgit.errors.NotSupportedException * the protocol specified is not supported. * @throws org.eclipse.jgit.errors.TransportException * the transport cannot open this URI. */ public static List<Transport> openAll(final Repository local, final RemoteConfig cfg, final Operation op) throws NotSupportedException, TransportException { final List<URIish> uris = getURIs(cfg, op); final List<Transport> transports = new ArrayList<>(uris.size()); for (URIish uri : uris) { final Transport tn = open(local, uri, cfg.getName()); tn.applyConfig(cfg); transports.add(tn); } return transports; }
JGitText.get().remoteConfigHasNoURIAssociated, cfg.getName())); final Transport tn = open(local, uris.get(0), cfg.getName()); tn.applyConfig(cfg); return tn;
JGitText.get().remoteConfigHasNoURIAssociated, cfg.getName())); final Transport tn = open(local, uris.get(0), cfg.getName()); tn.applyConfig(cfg); return tn;
private void push(Repository repo, ReplicaPushRequest req) throws NotSupportedException, TransportException, IOException { Map<String, Ref> adv; List<RemoteCommand> cmds = asUpdateList(req.getCommands()); try (Transport transport = Transport.open(repo, uri)) { RemoteConfig rc = getRemoteConfig(); if (rc != null) { transport.applyConfig(rc); } transport.setPushAtomic(true); adv = push(repo, transport, cmds); } for (RemoteCommand c : cmds) { c.copyStatusToResult(); } req.setRefs(adv); }
private void push(Repository repo, ReplicaPushRequest req) throws NotSupportedException, TransportException, IOException { Map<String, Ref> adv; List<RemoteCommand> cmds = asUpdateList(req.getCommands()); try (Transport transport = Transport.open(repo, uri)) { RemoteConfig rc = getRemoteConfig(); if (rc != null) { transport.applyConfig(rc); } transport.setPushAtomic(true); adv = push(repo, transport, cmds); } for (RemoteCommand c : cmds) { c.copyStatusToResult(); } req.setRefs(adv); }