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

} }
} }


@Override
protected boolean requiresRepository() {
return false;
}

private void show(final AnyObjectId id, final String name) private void show(final AnyObjectId id, final String name)
throws IOException { throws IOException {
outw.print(id.name()); outw.print(id.name());

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

public static Transport open(final Repository local, final String remote, public static Transport open(final Repository local, final String remote,
final Operation op) throws NotSupportedException, final Operation op) throws NotSupportedException,
URISyntaxException, TransportException { 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