Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2008-05-27 18:28:43 +0400
committerJunio C Hamano <gitster@pobox.com>2008-05-28 08:30:16 +0400
commit37b78c25476d752953dc541e46fbb6bd5017edf7 (patch)
tree2db26fcaed2a66faba00a8b4d582da5f0e3167f0
parentcb418b5a3882007616e00bc17b22e8653613ad5f (diff)
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 <peff@peff.net> Acked-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin-clone.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin-clone.c b/builtin-clone.c
index 4740b13067..f4accbe541 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)