From fb0cc87ec0f1e9c13b27ea2c89127991d44ed3d3 Mon Sep 17 00:00:00 2001 From: Daniel Barkalow Date: Wed, 18 Nov 2009 02:42:22 +0100 Subject: Allow programs to not depend on remotes having urls For fetch and ls-remote, which use the first url of a remote, have transport_get() determine this by passing a remote and passing NULL for the url. For push, which uses every url of a remote, use each url in turn if there are any, and use NULL if there are none. This will allow the transport code to do something different if the location is not specified with a url. Also, have the message for a fetch say "foreign" if there is no url. Signed-off-by: Daniel Barkalow Signed-off-by: Sverre Rabbelier Signed-off-by: Junio C Hamano --- transport.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'transport.c') diff --git a/transport.c b/transport.c index 644a30a0b2..9daa68609f 100644 --- a/transport.c +++ b/transport.c @@ -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:")) { -- cgit v1.2.3