Skip to content
Snippets Groups Projects
Commit 6f32b8e2 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Tobias Hunger
Browse files

Git: Append PATH env variable when locating binary


Complements d3f889df

Change-Id: I9f0186edb11695d3d1607615ce24f238d77ef46e
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 6f2cc3a3
No related branches found
No related tags found
No related merge requests found
......@@ -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()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment