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 --- builtin-ls-remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin-ls-remote.c') diff --git a/builtin-ls-remote.c b/builtin-ls-remote.c index 78a88f747..d625df2f4 100644 --- a/builtin-ls-remote.c +++ b/builtin-ls-remote.c @@ -89,7 +89,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix) remote = nongit ? NULL : remote_get(dest); if (remote && !remote->url_nr) die("remote %s has no configured URL", dest); - transport = transport_get(remote, remote ? remote->url[0] : dest); + transport = transport_get(remote, NULL); if (uploadpack != NULL) transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack); -- cgit v1.2.1