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

Function TestSSHGetExeAndArgsInvalidOptionsAsPath

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

Source from the content-addressed store, hash-verified

590}
591
592func TestSSHGetExeAndArgsInvalidOptionsAsPath(t *testing.T) {
593 cli, err := lfshttp.NewClient(nil)
594 require.Nil(t, err)
595
596 u, err := url.Parse("ssh://git@git-host.com/-oProxyCommand=gnome-calculator")
597 require.Nil(t, err)
598 assert.Equal(t, "git-host.com", u.Host)
599
600 e := lfshttp.EndpointFromSshUrl(u)
601 t.Logf("ENDPOINT: %+v", e)
602 assert.Equal(t, "git@git-host.com", e.SSHMetadata.UserAndHost)
603 assert.Equal(t, "/-oProxyCommand=gnome-calculator", e.SSHMetadata.Path)
604
605 exe, args, needShell, _, _ := ssh.GetExeAndArgs(cli.OSEnv(), cli.GitEnv(), &e.SSHMetadata, false, "")
606 assert.Equal(t, "ssh", exe)
607 assert.Equal(t, []string{"git@git-host.com"}, args)
608 assert.Equal(t, false, needShell)
609}
610
611func TestParseBareSSHUrl(t *testing.T) {
612 e := lfshttp.EndpointFromBareSshUrl("git@git-host.com:repo.git")

Callers

nothing calls this directly

Calls 7

OSEnvMethod · 0.95
GitEnvMethod · 0.95
NewClientFunction · 0.92
EndpointFromSshUrlFunction · 0.92
GetExeAndArgsFunction · 0.92
LogfMethod · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected