Commit bd3854a09c9bd4196cf280108d3f6286ee6de258

Carlos Martín Nieto 2014-08-31T17:12:45

transport: return ENOTFOUND for HTTPS and SSH when they're not supported The previous commit makes it harder to figure out if the library was built with support for a particular transport. Roll back some of the changes and remove ssh:// and https:// from the list if we're being built without support for them.

diff --git a/src/transport.c b/src/transport.c
index a5faf3f..3295b19 100644
--- a/src/transport.c
+++ b/src/transport.c
@@ -20,16 +20,22 @@ typedef struct transport_definition {
 
 static git_smart_subtransport_definition http_subtransport_definition = { git_smart_subtransport_http, 1 };
 static git_smart_subtransport_definition git_subtransport_definition = { git_smart_subtransport_git, 0 };
+#ifdef GIT_SSH
 static git_smart_subtransport_definition ssh_subtransport_definition = { git_smart_subtransport_ssh, 0 };
+#endif
 
 static transport_definition local_transport_definition = { "file://", git_transport_local, NULL };
 
 static transport_definition transports[] = {
 	{ "git://",   git_transport_smart, &git_subtransport_definition },
 	{ "http://",  git_transport_smart, &http_subtransport_definition },
+#if defined(GIT_SSL) || defined(GIT_WINHTTP)
 	{ "https://", git_transport_smart, &http_subtransport_definition },
+#endif
 	{ "file://",  git_transport_local, NULL },
+#ifdef GIT_SSH
 	{ "ssh://",   git_transport_smart, &ssh_subtransport_definition },
+#endif
 	{ NULL, 0, 0 }
 };