forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.2'
Conflicts: src/plugins/git/gerrit/gerritparameters.cpp src/plugins/git/gerrit/gerritplugin.h src/plugins/git/gitclient.cpp Change-Id: Ie7719cfe45489b72d64260e729dcce3760f33bec
This commit is contained in:
@@ -2639,6 +2639,24 @@ bool GitClient::launchGitGui(const QString &workingDirectory) {
|
||||
return success;
|
||||
}
|
||||
|
||||
Utils::FileName GitClient::gitBinDirectory()
|
||||
{
|
||||
const QString git = gitBinaryPath();
|
||||
if (git.isEmpty())
|
||||
return Utils::FileName();
|
||||
|
||||
// Is 'git\cmd' in the path (folder containing .bats)?
|
||||
QString path = QFileInfo(git).absolutePath();
|
||||
// Git for Windows (msysGit) has git and gitk redirect executables in {setup dir}/cmd
|
||||
// and the real binaries are in {setup dir}/bin. If cmd is configured in PATH
|
||||
// or in Git settings, return bin instead.
|
||||
if (Utils::HostOsInfo::isWindowsHost()
|
||||
&& path.endsWith(QLatin1String("/cmd"), Utils::HostOsInfo::fileNameCaseSensitivity())) {
|
||||
path.replace(path.size() - 3, 3, QLatin1String("bin"));
|
||||
}
|
||||
return Utils::FileName::fromString(path);
|
||||
}
|
||||
|
||||
Utils::FileName GitClient::gitBinaryPath(bool *ok, QString *errorMessage) const
|
||||
{
|
||||
return settings()->gitBinaryPath(ok, errorMessage);
|
||||
|
||||
Reference in New Issue
Block a user