xdiff/xhistogram: move index allocation into find_lcs
[gitweb.git] / connect.c
index c75bf52ee29040626f89bc1daf85aab742915e91..048fa049170c8f6912ac96b7b547f2f28a74995e 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -663,6 +663,19 @@ static enum protocol parse_connect_url(const char *url_orig, char **ret_host,
 
 static struct child_process no_fork = CHILD_PROCESS_INIT;
 
+static const char *get_ssh_command(void)
+{
+       const char *ssh;
+
+       if ((ssh = getenv("GIT_SSH_COMMAND")))
+               return ssh;
+
+       if (!git_config_get_string_const("core.sshcommand", &ssh))
+               return ssh;
+
+       return NULL;
+}
+
 /*
  * This returns a dummy child_process if the transport protocol does not
  * need fork(2), or a struct child_process object if it does.  Once done,
@@ -769,7 +782,7 @@ struct child_process *git_connect(int fd[2], const char *url,
                        if (looks_like_command_line_option(ssh_host))
                                die("strange hostname '%s' blocked", ssh_host);
 
-                       ssh = getenv("GIT_SSH_COMMAND");
+                       ssh = get_ssh_command();
                        if (!ssh) {
                                const char *base;
                                char *ssh_dup;