forked from qt-creator/qt-creator
Core: Use "patch" from git on Windows
On my system where I have strawberry perl installed, the "patch.exe" from strawberry perl is picked. This patch.exe has issues while reverting chunks, where as git's patch.exe works perfectly. Change-Id: I7e8c8f91f0f841c128ff8538dba68bee161a5f7b Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -24,9 +24,18 @@ FilePath PatchTool::patchCommand()
|
||||
QSettings *s = ICore::settings();
|
||||
|
||||
s->beginGroup(settingsGroupC);
|
||||
const FilePath command = FilePath::fromSettings(s->value(patchCommandKeyC, patchCommandDefaultC));
|
||||
FilePath command = FilePath::fromSettings(s->value(patchCommandKeyC, patchCommandDefaultC));
|
||||
s->endGroup();
|
||||
|
||||
if (HostOsInfo::isWindowsHost() && command.path() == patchCommandDefaultC) {
|
||||
const QSettings settings(R"(HKEY_LOCAL_MACHINE\SOFTWARE\GitForWindows)",
|
||||
QSettings::NativeFormat);
|
||||
const FilePath gitInstall = FilePath::fromUserInput(settings.value("InstallPath").toString());
|
||||
if (gitInstall.exists())
|
||||
command = command.searchInPath({gitInstall.pathAppended("usr/bin")},
|
||||
Utils::FilePath::PrependToPath);
|
||||
}
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user