Git: Prepend to PATH instead of replacing it

Change-Id: Ia6d783e97d7f4c80a3838b0167dcdcfce5fe4a6e
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Orgad Shaneh
2012-01-27 09:52:06 +02:00
committed by Tobias Hunger
parent e2ace515e2
commit d3f889df7d
6 changed files with 11 additions and 33 deletions

View File

@@ -39,7 +39,6 @@
namespace Git {
namespace Internal {
const QLatin1String GitSettings::adoptPathKey("SysEnv");
const QLatin1String GitSettings::pathKey("Path");
const QLatin1String GitSettings::pullRebaseKey("PullRebase");
const QLatin1String GitSettings::omitAnnotationDateKey("OmitAnnotationDate");
@@ -61,7 +60,6 @@ GitSettings::GitSettings()
#else
declareKey(timeoutKey, 30);
#endif
declareKey(adoptPathKey, false);
declareKey(pathKey, QString());
declareKey(pullRebaseKey, false);
declareKey(omitAnnotationDateKey, false);
@@ -87,7 +85,7 @@ QString GitSettings::gitBinaryPath(bool *ok, QString *errorMessage) const
const QString binary = stringValue(binaryPathKey);
QString currentPath = stringValue(pathKey);
// Easy, git is assumed to be elsewhere accessible
if (!boolValue(adoptPathKey))
if (currentPath.isEmpty())
currentPath = QString::fromLocal8Bit(qgetenv("PATH"));
// Search in path?
m_binaryPath = Utils::SynchronousProcess::locateBinary(currentPath, binary);