forked from qt-creator/qt-creator
Git: Modernize executable search
Change-Id: I3bc1293aab74fcff5574d9a339a52776c891b6cf Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user