Allow programs to not depend on remotes having urls
[gitweb.git] / transport.c
index 644a30a0b200b339d291f4cc3d35b2268d12facd..9daa68609f51048be096bb2df2279e65f288d60b 100644 (file)
@@ -813,6 +813,9 @@ struct transport *transport_get(struct remote *remote, const char *url)
        struct transport *ret = xcalloc(1, sizeof(*ret));
 
        ret->remote = remote;
+
+       if (!url && remote && remote->url)
+               url = remote->url[0];
        ret->url = url;
 
        if (!prefixcmp(url, "rsync:")) {