public ApplyConfig ( |
||
cfg | ||
return | void |
/// <summary> /// Support for Transport over HTTP and Git (Anon+SSH) /// </summary> /// <param name="local"></param> /// <param name="cfg"></param> /// <returns></returns> public static Transport Open(Repository local, RemoteConfig cfg) { if (cfg.URIs.Count == 0) { throw new ArgumentException("Remote config \"" + cfg.Name + "\" has no URIs associated"); } Transport tn = Open(local, cfg.URIs[0]); tn.ApplyConfig(cfg); return(tn); }
public static List <Transport> openAll(Repository local, RemoteConfig cfg) { List <URIish> uris = cfg.URIs; var tranports = new List <Transport>(uris.Count); foreach (URIish uri in uris) { Transport tn = Open(local, uri); tn.ApplyConfig(cfg); tranports.Add(tn); } return(tranports); }
/// <summary> /// Open a new transport instance to connect two repositories. /// </summary> /// <param name="local">existing local repository.</param> /// <param name="cfg"> /// configuration describing how to connect to the remote /// repository. /// </param> /// <param name="op"> /// planned use of the returned Transport; the URI may differ /// based on the type of connection desired. /// </param> /// <returns></returns> public static Transport open(Repository local, RemoteConfig cfg, Operation op) { List <URIish> uris = getURIs(cfg, op); if (uris.isEmpty()) { throw new ArgumentException( "Remote config \"" + cfg.Name + "\" has no URIs associated"); } Transport tn = open(local, uris[0]); tn.ApplyConfig(cfg); return(tn); }