diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-08-31 17:12:45 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-08-31 18:01:44 +0200 |
commit | bd3854a09c9bd4196cf280108d3f6286ee6de258 (patch) | |
tree | 7858bb5331d69b89c51507ce59ac36960599a2ae | |
parent | dbc77850ff62b134d7fe7ab659ca2d3ef24cf556 (diff) | |
download | libgit2-bd3854a09c9bd4196cf280108d3f6286ee6de258.tar.gz |
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.
-rw-r--r-- | src/transport.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/transport.c b/src/transport.c index a5faf3f19..3295b196c 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 } }; |