diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java index 1842b725e..93fcd66c5 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java @@ -80,6 +80,11 @@ class LsRemote extends TextBuiltin { } } + @Override + protected boolean requiresRepository() { + return false; + } + private void show(final AnyObjectId id, final String name) throws IOException { outw.print(id.name()); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java index 837bd58d8..3ad1db2d4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java @@ -311,10 +311,14 @@ public abstract class Transport { 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)); + } /**