public static Transport open(final Repository local, final String remote,
final Operation op) throws NotSupportedException,
URISyntaxException, TransportException {
- final RemoteConfig cfg = new RemoteConfig(local.getConfig(), remote);
- if (doesNotExist(cfg))
- return open(local, new URIish(remote), null);
- return open(local, cfg, op);
+ if (local != null) {
+ final RemoteConfig cfg = new RemoteConfig(local.getConfig(), remote);
+ if (doesNotExist(cfg))
+ return open(local, new URIish(remote), null);
+ return open(local, cfg, op);
+ } else
+ return open(new URIish(remote));
+
}
/**