/// <summary>
/// Open a new transport instance to connect two repositories.
/// </summary>
/// <param name="local">existing local repository.</param>
/// <param name="remote">location of the remote repository.</param>
/// <returns>the new transport instance. Never null.</returns>
public static Transport open(Repository local, URIish remote)
{
if (TransportGitSsh.canHandle(remote))
{
return(new TransportGitSsh(local, remote));
}
if (TransportHttp.canHandle(remote))
{
return(new TransportHttp(local, remote));
}
if (TransportSftp.canHandle(remote))
{
return(new TransportSftp(local, remote));
}
if (TransportGitAnon.canHandle(remote))
{
return(new TransportGitAnon(local, remote));
}
if (TransportAmazonS3.canHandle(remote))
{
return(new TransportAmazonS3(local, remote));
}
if (TransportBundleFile.canHandle(remote))
{
return(new TransportBundleFile(local, remote));
}
if (TransportLocal.canHandle(remote))
{
return(new TransportLocal(local, remote));
}
throw new NotSupportedException("URI not supported: " + remote);
}