Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-50573] Prefer URL username with ssh URL
When using an ssh private key, the CliGitAPIImpl implementation previously passed a "-l" command line argument from the username associated with the ssh key. OpenSSH implementations prior to OpenSSH 7.7 would only use that command line argument if no username were included in the ssh URI. OpenSSH 7.7 changes the ssh command line argument parsing rules. Previously, the last user name specified would be used, including the user name in the URL. With OpenSSH 7.7, the first user name specified is used, even if a user name is specified in the URL. The command line: ssh -l jenkins git@github.com:jenkinsci/git-client-plugin.git uses the username 'git' with OpenSSH versions before 7.7 and uses the username 'jenkins' with OpenSSH 7.7. OpenSSH 7.7 is included in Windows Git 2.17 and in OpenBSD 6.3. The CredentialsTest class can test this case.
- Loading branch information