(t *testing.T)
| 590 | } |
| 591 | |
| 592 | func 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 | |
| 611 | func TestParseBareSSHUrl(t *testing.T) { |
| 612 | e := lfshttp.EndpointFromBareSshUrl("git@git-host.com:repo.git") |
nothing calls this directly
no test coverage detected