MCPcopy
hub / github.com/git-lfs/git-lfs / TestSSHGetExeAndArgsSshMultiplexingExtra

Function TestSSHGetExeAndArgsSshMultiplexingExtra

ssh/ssh_test.go:114–132  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

112}
113
114func TestSSHGetExeAndArgsSshMultiplexingExtra(t *testing.T) {
115 cli, err := lfshttp.NewClient(lfshttp.NewContext(nil, map[string]string{
116 "GIT_SSH_COMMAND": "",
117 "GIT_SSH": "",
118 }, map[string]string{
119 "lfs.ssh.automultiplex": "true",
120 }))
121 require.Nil(t, err)
122
123 meta := ssh.SSHMetadata{}
124 meta.UserAndHost = "user@foo.com"
125
126 exe, baseargs, needShell, multiplexing, controlPath := ssh.GetExeAndArgs(cli.OSEnv(), cli.GitEnv(), &meta, true, "/tmp/lfs/lfs.sock")
127 exe, args := ssh.FormatArgs(exe, baseargs, needShell)
128 assert.Equal(t, "ssh", exe)
129 assert.Equal(t, true, multiplexing)
130 assert.Equal(t, []string{"-oControlMaster=no", "-oControlPath=/tmp/lfs/lfs.sock", "user@foo.com"}, args)
131 assert.Equal(t, "/tmp/lfs/lfs.sock", controlPath)
132}
133
134func TestSSHGetExeAndArgsPlink(t *testing.T) {
135 plink := filepath.Join("Users", "joebloggs", "bin", "plink.exe")

Callers

nothing calls this directly

Calls 7

OSEnvMethod · 0.95
GitEnvMethod · 0.95
NewClientFunction · 0.92
NewContextFunction · 0.92
GetExeAndArgsFunction · 0.92
FormatArgsFunction · 0.92
EqualMethod · 0.45

Tested by

no test coverage detected