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>
This commit is contained in:
Robin Rosenberg 2014-06-06 21:18:16 +02:00 committed by Matthias Sohn
parent 2475d95374
commit bbe99d5b39
2 changed files with 13 additions and 4 deletions

View File

@ -80,6 +80,11 @@ protected void run() throws Exception {
}
}
@Override
protected boolean requiresRepository() {
return false;
}
private void show(final AnyObjectId id, final String name)
throws IOException {
outw.print(id.name());

View File

@ -311,10 +311,14 @@ 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,
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));
}
/**