Allow programs to not depend on remotes having urls
[gitweb.git] / builtin-fetch.c
index a35a6f8cb8030bf9be98a001da26fddf0efdb912..013a6ba1b9d4522863d22516a6134142bbcaaa68 100644 (file)
@@ -309,7 +309,10 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
        if (!fp)
                return error("cannot open %s: %s\n", filename, strerror(errno));
 
-       url = transport_anonymize_url(raw_url);
+       if (raw_url)
+               url = transport_anonymize_url(raw_url);
+       else
+               url = xstrdup("foreign");
        for (rm = ref_map; rm; rm = rm->next) {
                struct ref *ref = NULL;
 
@@ -704,7 +707,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
        if (!remote)
                die("Where do you want to fetch from today?");
 
-       transport = transport_get(remote, remote->url[0]);
+       transport = transport_get(remote, NULL);
        if (verbosity >= 2)
                transport->verbose = 1;
        if (verbosity < 0)