Skip to content

Commit cd34771

Browse files
[JENKINS-72450] Support alternate ssh implementations on Windows (#1706)
1 parent 1990f3f commit cd34771

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2638,6 +2638,15 @@ public File getSSHExecutable() {
26382638
return sshexe;
26392639
}
26402640

2641+
// Check for ssh.exe on the system PATH (supports Microsoft OpenSSH and other alternate implementations)
2642+
String sshPath = getPathToExe("ssh");
2643+
if (sshPath != null) {
2644+
sshexe = new File(sshPath);
2645+
if (sshexe.exists()) {
2646+
return sshexe;
2647+
}
2648+
}
2649+
26412650
// Check Program Files
26422651
sshexe = getFileFromEnv("ProgramFiles", "\\Git\\bin\\ssh.exe");
26432652
if (sshexe != null && sshexe.exists()) {

0 commit comments

Comments
 (0)