Allow specifying the remote helper in the url
The common case for remote helpers will be to import some repository which can be specified by a single URL. Support this use case by allowing users to say: git clone hg::https://soc.googlecode.com/hg/ soc Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Nov 18, 2009 at 02:42 UTC
87422439d100f020cadb63b5da8495e5fbfb8fa3
1 file changed
+10
transport.c
+10
@@ -818,6 +818,16 @@ struct transport *transport_get(struct remote *remote, const char *url)
818
url = remote->url[0];
819
ret->url = url;
820
821
+ /* maybe it is a foreign URL? */
822
+ if (url) {
823
+ const char *p = url;
824
+
825
+ while (isalnum(*p))
826
+ p++;
827
+ if (!prefixcmp(p, "::"))
828
+ remote->foreign_vcs = xstrndup(url, p - url);
829
+ }
830
+
831
if (remote && remote->foreign_vcs) {
832
transport_helper_init(ret, remote->foreign_vcs);
833
return ret;