Skip to content
Open
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2626,6 +2626,15 @@
return sshexe;
}

// Check for ssh.exe on the system PATH (supports Microsoft OpenSSH and other alternate implementations)
String sshPath = getPathToExe("ssh");
if (sshPath != null) {
sshexe = new File(sshPath);
if (sshexe.exists()) {
return sshexe;

Check warning on line 2634 in src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 2630-2634 are not covered by tests
}
}

// Check Program Files
sshexe = getFileFromEnv("ProgramFiles", "\\Git\\bin\\ssh.exe");
if (sshexe != null && sshexe.exists()) {
Expand Down Expand Up @@ -2701,7 +2710,8 @@
w.write("setlocal enabledelayedexpansion");
w.newLine();
w.write("\"" + sshexe.getAbsolutePath()
+ "\" -i \"!JENKINS_GIT_SSH_KEYFILE!\" -l \"!JENKINS_GIT_SSH_USERNAME!\" "
+ "\" -n -T -i \"!JENKINS_GIT_SSH_KEYFILE!\" -l \"!JENKINS_GIT_SSH_USERNAME!\" "
+ "-o BatchMode=yes -o PasswordAuthentication=no -o StrictHostKeyChecking=yes "
Comment thread
MarkEWaite marked this conversation as resolved.
Outdated
+ getHostKeyFactory().forCliGit(listener).getVerifyHostKeyOption(knownHosts) + " %* ");
w.newLine();
}
Expand All @@ -2724,7 +2734,8 @@
w.newLine();
w.write("fi");
w.newLine();
w.write("ssh -i \"$JENKINS_GIT_SSH_KEYFILE\" -l \"$JENKINS_GIT_SSH_USERNAME\" "
w.write("ssh -n -T -i \"$JENKINS_GIT_SSH_KEYFILE\" -l \"$JENKINS_GIT_SSH_USERNAME\" "
+ "-o BatchMode=yes -o PasswordAuthentication=no -o StrictHostKeyChecking=yes "
Comment thread
MarkEWaite marked this conversation as resolved.
Outdated
+ getHostKeyFactory().forCliGit(listener).getVerifyHostKeyOption(knownHosts) + " \"$@\"");
w.newLine();
}
Expand Down
Loading