Browse Source

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>
tags/v3.5.0.201409071800-rc1
Robin Rosenberg 10 years ago
parent
commit
bbe99d5b39

+ 5
- 0
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java View File

@@ -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());

+ 8
- 4
org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java View File

@@ -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));

}

/**

Loading…
Cancel
Save