(t *testing.T)
| 169 | } |
| 170 | |
| 171 | func TestSSHGetExeAndArgsPlinkCustomPortExplicitEnvironment(t *testing.T) { |
| 172 | plink := filepath.Join("Users", "joebloggs", "bin", "ssh") |
| 173 | |
| 174 | cli, err := lfshttp.NewClient(lfshttp.NewContext(nil, map[string]string{ |
| 175 | "GIT_SSH_COMMAND": "", |
| 176 | "GIT_SSH": plink, |
| 177 | "GIT_SSH_VARIANT": "plink", |
| 178 | }, nil)) |
| 179 | require.Nil(t, err) |
| 180 | |
| 181 | meta := ssh.SSHMetadata{} |
| 182 | meta.UserAndHost = "user@foo.com" |
| 183 | meta.Port = "8888" |
| 184 | |
| 185 | exe, args, needShell, _, _ := ssh.GetExeAndArgs(cli.OSEnv(), cli.GitEnv(), &meta, false, "") |
| 186 | exe, args = ssh.FormatArgs(exe, args, needShell) |
| 187 | assert.Equal(t, plink, exe) |
| 188 | assert.Equal(t, []string{"-P", "8888", "user@foo.com"}, args) |
| 189 | } |
| 190 | |
| 191 | func TestSSHGetExeAndArgsPlinkCustomPortExplicitEnvironmentPutty(t *testing.T) { |
| 192 | plink := filepath.Join("Users", "joebloggs", "bin", "ssh") |
nothing calls this directly
no test coverage detected