ProjectExplorer: prefer git ssh over windows ssh

In contrast to the git provided ssh the current ssh provided in windows
ignores the SSH_ASKPASS environment variable. So we should prefer the
implementation of git. This was done correctly in previous versions of
Qt Creator since Environment::searchInPath first went through the
additional provided directories before looking into the PATH environment
variable. This behavior changed in 11.0 and now we look first into the
entries of PATH.

Change-Id: I4f3c21866d2d1a5151998fd527978ed482946ef8
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2023-08-10 09:18:18 +02:00
parent 9fc53ef745
commit d2434d90dc

View File

@@ -107,10 +107,10 @@ static FilePath filePathValue(const FilePath &value, const QStringList &candidat
{
if (!value.isEmpty())
return value;
const FilePaths additionalSearchPaths = sshSettings->searchPathRetriever();
Environment env = Environment::systemEnvironment();
env.prependToPath(sshSettings->searchPathRetriever());
for (const QString &candidate : candidateFileNames) {
const FilePath filePath = Environment::systemEnvironment()
.searchInPath(candidate, additionalSearchPaths);
const FilePath filePath = env.searchInPath(candidate);
if (!filePath.isEmpty())
return filePath;
}