summaryrefslogtreecommitdiff
path: root/src/plugins/git/gitsettings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/git/gitsettings.cpp')
-rw-r--r--src/plugins/git/gitsettings.cpp9
1 files changed, 6 insertions, 3 deletions
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()) {