From: Jeff King Date: Tue, 27 May 2008 14:28:43 +0000 (-0400) Subject: clone: make sure we support the transport type X-Git-Tag: v1.5.6-rc1~38 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=37b78c25476d752953dc541e46fbb6bd5017edf7;p=git.git clone: make sure we support the transport type If we use an unsupported transport (e.g., http when curl support is not compiled in), transport_get reports an error to the user, but we still get a transport object. We need to manually check and abort the clone process at that point, or we end up with a segfault. Noticed by Thomas Rast. Signed-off-by: Jeff King Acked-by: Daniel Barkalow Signed-off-by: Junio C Hamano --- diff --git a/builtin-clone.c b/builtin-clone.c index 4740b1306..f4accbe54 100644 --- a/builtin-clone.c +++ b/builtin-clone.c @@ -449,6 +449,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix) struct remote *remote = remote_get(argv[0]); struct transport *transport = transport_get(remote, argv[0]); + if (!transport->get_refs_list || !transport->fetch) + die("Don't know how to clone %s", transport->url); + transport_set_option(transport, TRANS_OPT_KEEP, "yes"); if (option_depth)