Allow specifying the remote helper in the url
[gitweb.git] / transport.c
index 5ae8db6335ee9dc75b39065c27f9fa3cb3d09d9e..5d814b50e4c1b52df4b1ab2c5fbebaeedc16e634 100644 (file)
@@ -818,6 +818,21 @@ struct transport *transport_get(struct remote *remote, const char *url)
                url = remote->url[0];
        ret->url = url;
 
+       /* maybe it is a foreign URL? */
+       if (url) {
+               const char *p = url;
+
+               while (isalnum(*p))
+                       p++;
+               if (!prefixcmp(p, "::"))
+                       remote->foreign_vcs = xstrndup(url, p - url);
+       }
+
+       if (remote && remote->foreign_vcs) {
+               transport_helper_init(ret, remote->foreign_vcs);
+               return ret;
+       }
+
        if (!prefixcmp(url, "rsync:")) {
                ret->get_refs_list = get_refs_via_rsync;
                ret->fetch = fetch_objs_via_rsync;