Skip to content

Commit

Permalink
[Fix JENKINS-28943] Find windows ssh even if git is absolute path to …
Browse files Browse the repository at this point in the history
…cmd dir

The path guesser in getPathToExe correctly checks for cmd and exe
suffixes, and correctly checks each entry in the PATH environment
variable.  Prior to this change, it did not check for the absolute
path having been specified with the cmd directory rather than the bin
directory.

The user had set C:\Program Files\Git\cmd\git.exe as the git program
for that slave.  That is an allowed setting, and it executed most git
commands correctly. It failed on ssh based commands.
  • Loading branch information
MarkEWaite committed Jun 20, 2015
1 parent f4d2340 commit 3e5ad16
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -1463,6 +1463,11 @@ private String getPathToExe(String userGitExe) {
}
}

File userGitFile = new File(userGitExe);
if (userGitFile.exists()) {
return userGitFile.getAbsolutePath();
}

return null;
}

Expand Down

0 comments on commit 3e5ad16

Please sign in to comment.