Git: Modernize executable search

Change-Id: I3bc1293aab74fcff5574d9a339a52776c891b6cf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2021-09-30 09:34:05 +02:00
parent 61f04d260c
commit 73e072c7bb
3 changed files with 16 additions and 8 deletions

View File

@@ -141,11 +141,9 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const
errorMessage->clear();
FilePath binPath = binaryPath.filePath();
if (!binPath.isAbsolutePath()) {
Environment env = Environment::systemEnvironment();
env.prependOrSetPath(path.filePath());
binPath = env.searchInPath(binPath.toString());
}
if (!binPath.isAbsolutePath())
binPath = binPath.searchInPath({path.filePath()}, FilePath::PrependToPath);
if (binPath.isEmpty()) {
if (ok)
*ok = false;