Git: Append PATH env variable when locating binary

Complements d3f889df7d

Change-Id: I9f0186edb11695d3d1607615ce24f238d77ef46e
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Orgad Shaneh
2012-08-15 09:34:55 +03:00
committed by Tobias Hunger
parent 6f2cc3a32e
commit 6f32b8e257

View File

@@ -84,9 +84,12 @@ QString GitSettings::gitBinaryPath(bool *ok, QString *errorMessage) const
if (m_binaryPath.isEmpty()) {
const QString binary = stringValue(binaryPathKey);
QString currentPath = stringValue(pathKey);
// Easy, git is assumed to be elsewhere accessible
if (currentPath.isEmpty())
currentPath = QString::fromLocal8Bit(qgetenv("PATH"));
QString systemPath = QString::fromLocal8Bit(qgetenv("PATH"));
if (!systemPath.isEmpty()) {
if (!currentPath.isEmpty())
currentPath.append(Utils::SynchronousProcess::pathSeparator());
currentPath.append(systemPath);
}
// Search in path?
m_binaryPath = Utils::SynchronousProcess::locateBinary(currentPath, binary);
if (m_binaryPath.isEmpty()) {