aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java
index 3843dc4a18..55ca58f9cb 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java
@@ -61,6 +61,7 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.transport.FetchConnection;
import org.eclipse.jgit.transport.RefSpec;
import org.eclipse.jgit.transport.Transport;
+import org.eclipse.jgit.transport.URIish;
/**
* The ls-remote command
@@ -82,6 +83,8 @@ public class LsRemoteCommand extends
/**
* @param repo
+ * local repository or null for operation without local
+ * repository
*/
public LsRemoteCommand(Repository repo) {
super(repo);
@@ -155,7 +158,10 @@ public class LsRemoteCommand extends
Transport transport = null;
FetchConnection fc = null;
try {
- transport = Transport.open(repo, remote);
+ if (repo != null)
+ transport = Transport.open(repo, remote);
+ else
+ transport = Transport.open(new URIish(remote));
transport.setOptionUploadPack(uploadPack);
configure(transport);
Collection<RefSpec> refSpecs = new ArrayList<RefSpec>(1);