forked from qt-creator/qt-creator
Git: Support HOMEDRIVE/HOMEPATH home directory
MSYS is using %HOMEDRIVE%%HOMEPATH% as home if exists, and falls back to %USERPROFILE%. So Git settings are supposed to be in HOMEDRIVE on this case. Change-Id: Ia15fd30031eedd3e7669e63b265bed83b03518c8 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
a2c861beaa
commit
0d600b0761
@@ -2223,8 +2223,14 @@ Environment GitClient::processEnvironment() const
|
|||||||
Environment environment = VcsBaseClientImpl::processEnvironment();
|
Environment environment = VcsBaseClientImpl::processEnvironment();
|
||||||
QString gitPath = settings().path.value();
|
QString gitPath = settings().path.value();
|
||||||
environment.prependOrSetPath(FilePath::fromUserInput(gitPath));
|
environment.prependOrSetPath(FilePath::fromUserInput(gitPath));
|
||||||
if (HostOsInfo::isWindowsHost() && settings().winSetHomeEnvironment.value())
|
if (HostOsInfo::isWindowsHost() && settings().winSetHomeEnvironment.value()) {
|
||||||
environment.set("HOME", QDir::toNativeSeparators(QDir::homePath()));
|
QString homePath;
|
||||||
|
if (const char *homeDrive = qgetenv("HOMEDRIVE"))
|
||||||
|
homePath = QString::fromLocal8Bit(homeDrive) + QString::fromLocal8Bit(qgetenv("HOMEPATH"));
|
||||||
|
else
|
||||||
|
homePath = QDir::toNativeSeparators(QDir::homePath());
|
||||||
|
environment.set("HOME", homePath);
|
||||||
|
}
|
||||||
environment.set("GIT_EDITOR", m_disableEditor ? "true" : m_gitQtcEditor);
|
environment.set("GIT_EDITOR", m_disableEditor ? "true" : m_gitQtcEditor);
|
||||||
return environment;
|
return environment;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user