summaryrefslogtreecommitdiff
path: root/connect.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-05 12:46:27 -0700
committerJunio C Hamano <gitster@pobox.com>2015-10-05 13:20:08 -0700
commit590f6e4235a7d44ad39511186ca8bbac02ae8c2e (patch)
tree6999a9512d87bbc06dfb3308fdc824e5226e7597 /connect.c
parente13d854322ad802213aea13409505c765b5c68d1 (diff)
parent22f698cb188243b313e024d618283e0293e37140 (diff)
downloadgit-590f6e4235a7d44ad39511186ca8bbac02ae8c2e.tar.gz
Sync with 2.6.1
Diffstat (limited to 'connect.c')
-rw-r--r--connect.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/connect.c b/connect.c
index acd39d70c8..ced4961398 100644
--- a/connect.c
+++ b/connect.c
@@ -9,6 +9,7 @@
#include "url.h"
#include "string-list.h"
#include "sha1-array.h"
+#include "transport.h"
static char *server_capabilities;
static const char *parse_feature_value(const char *, const char *, int *);
@@ -694,6 +695,8 @@ struct child_process *git_connect(int fd[2], const char *url,
else
target_host = xstrdup(hostandport);
+ transport_check_allowed("git");
+
/* These underlying connection commands die() if they
* cannot connect.
*/
@@ -730,6 +733,7 @@ struct child_process *git_connect(int fd[2], const char *url,
int putty = 0, tortoiseplink = 0;
char *ssh_host = hostandport;
const char *port = NULL;
+ transport_check_allowed("ssh");
get_host_and_port(&ssh_host, &port);
if (!port)
@@ -785,6 +789,8 @@ struct child_process *git_connect(int fd[2], const char *url,
argv_array_push(&conn->args, port);
}
argv_array_push(&conn->args, ssh_host);
+ } else {
+ transport_check_allowed("file");
}
argv_array_push(&conn->args, cmd.buf);