Git: Do not require the path to be set in the config

Fix regression where creator was no longer able to run git if the
PATH was not explicitly set in the configuration.

Task-number: QTCREATORBUG-2478
Reviewed-by: Robert Loehning
This commit is contained in:
Tobias Hunger
2010-09-28 12:55:35 +02:00
parent 16f2712403
commit 7a40a7bb0e
2 changed files with 6 additions and 4 deletions

View File

@@ -128,11 +128,12 @@ QString GitSettings::gitBinaryPath(bool *ok, QString *errorMessage) const
if (errorMessage)
errorMessage->clear();
const QString binary = QLatin1String(Constants::GIT_BINARY);
QString currentPath = path;
// Easy, git is assumed to be elsewhere accessible
if (!adoptPath)
return binary;
currentPath = QString::fromLocal8Bit(qgetenv("PATH"));
// Search in path?
const QString pathBinary = Utils::SynchronousProcess::locateBinary(path, binary);
const QString pathBinary = Utils::SynchronousProcess::locateBinary(currentPath, binary);
if (pathBinary.isEmpty()) {
if (ok)
*ok = false;
@@ -144,5 +145,5 @@ QString GitSettings::gitBinaryPath(bool *ok, QString *errorMessage) const
return pathBinary;
}
}
}
} // namespace Internal
} // namespace Git