Merge branch 'tk/typofix-connect-unknown-proto-error' into maint
authorJunio C Hamano <gitster@pobox.com>
Fri, 16 Oct 2015 21:32:55 +0000 (14:32 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Oct 2015 21:32:55 +0000 (14:32 -0700)
* tk/typofix-connect-unknown-proto-error:
connect: fix typo in result string of prot_name()

1  2 
connect.c
diff --combined connect.c
index ced4961398d397e0e21661ce7105be293c3585c2,777f31c249c0a90722206f0f8bde5f29bad70db5..d3283b8a4f3e8ed8451e723ce8b39d468aaa3dd3
+++ b/connect.c
@@@ -9,7 -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 *);
@@@ -255,7 -254,7 +255,7 @@@ static const char *prot_name(enum proto
                case PROTO_GIT:
                        return "git";
                default:
-                       return "unkown protocol";
+                       return "unknown protocol";
        }
  }
  
@@@ -695,8 -694,6 +695,8 @@@ struct child_process *git_connect(int f
                else
                        target_host = xstrdup(hostandport);
  
 +              transport_check_allowed("git");
 +
                /* These underlying connection commands die() if they
                 * cannot connect.
                 */
                strbuf_addch(&cmd, ' ');
                sq_quote_buf(&cmd, path);
  
 +              /* remove repo-local variables from the environment */
 +              conn->env = local_repo_env;
 +              conn->use_shell = 1;
                conn->in = conn->out = -1;
                if (protocol == PROTO_SSH) {
                        const char *ssh;
 -                      int putty, tortoiseplink = 0;
 +                      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)
                        }
  
                        ssh = getenv("GIT_SSH_COMMAND");
 -                      if (ssh) {
 -                              conn->use_shell = 1;
 -                              putty = 0;
 -                      } else {
 +                      if (!ssh) {
                                const char *base;
                                char *ssh_dup;
  
 +                              /*
 +                               * GIT_SSH is the no-shell version of
 +                               * GIT_SSH_COMMAND (and must remain so for
 +                               * historical compatibility).
 +                               */
 +                              conn->use_shell = 0;
 +
                                ssh = getenv("GIT_SSH");
                                if (!ssh)
                                        ssh = "ssh";
  
                                tortoiseplink = !strcasecmp(base, "tortoiseplink") ||
                                        !strcasecmp(base, "tortoiseplink.exe");
 -                              putty = !strcasecmp(base, "plink") ||
 -                                      !strcasecmp(base, "plink.exe") || tortoiseplink;
 +                              putty = tortoiseplink ||
 +                                      !strcasecmp(base, "plink") ||
 +                                      !strcasecmp(base, "plink.exe");
  
                                free(ssh_dup);
                        }
                        }
                        argv_array_push(&conn->args, ssh_host);
                } else {
 -                      /* remove repo-local variables from the environment */
 -                      conn->env = local_repo_env;
 -                      conn->use_shell = 1;
 +                      transport_check_allowed("file");
                }
                argv_array_push(&conn->args, cmd.buf);