diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2014-06-06 21:18:16 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2014-09-07 01:10:51 +0200 |
commit | bbe99d5b39326f618fec0702bfabbfa374f09b00 (patch) | |
tree | 238ceab29fd6679500e72901f6d08bcf3753db4c /org.eclipse.jgit/src/org | |
parent | 2475d95374d28c7df4ac12baef22090da4f409ba (diff) | |
download | jgit-bbe99d5b39326f618fec0702bfabbfa374f09b00.tar.gz jgit-bbe99d5b39326f618fec0702bfabbfa374f09b00.zip |
Fix the ls-remote command when there is no local repo
Bug: 436695
Change-Id: I567f9a8e355c7624efa3efc9bac4f3b9015afa97
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java | 12 |
1 files changed, 8 insertions, 4 deletions
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 837bd58d82..3ad1db2d49 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)); + } /** |