From 6f32b8e25722a461f9e24e32a8fd94929926bda2 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 15 Aug 2012 09:34:55 +0300 Subject: Git: Append PATH env variable when locating binary Complements d3f889df7d59ac3f7f7676c569a9828d56e66fe5 Change-Id: I9f0186edb11695d3d1607615ce24f238d77ef46e Reviewed-by: Tobias Hunger --- src/plugins/git/gitsettings.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index 6c40c289d8..c4fca8d32d 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -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()) { -- cgit v1.2.1