From af1cc6831cfe9c8f891c610020754fe091bc4d7b Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 24 Dec 2012 14:25:23 +0200 Subject: [PATCH] Git: Avoid running wish if git/cmd is in PATH It always fails and falls back to git/bin Change-Id: I367ff33c864adebf438cbcc00332520ec6e0d454 Reviewed-by: Petar Perisin Reviewed-by: Friedemann Kleint --- src/plugins/git/gitclient.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 40228fd009b..d4d1c03437b 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1716,15 +1716,15 @@ bool GitClient::tryLauchingGitK(const QProcessEnvironment &env, const QString &gitBinDirectory, bool silent) { - QString binary; + QString binary = gitBinDirectory + QLatin1String("/gitk"); QStringList arguments; if (Utils::HostOsInfo::isWindowsHost()) { - // Launch 'wish' shell from git binary directory with the gitk located there - binary = gitBinDirectory + QLatin1String("/wish"); - arguments << (gitBinDirectory + QLatin1String("/gitk")); - } else { - // Simple: Run gitk from binary path - binary = gitBinDirectory + QLatin1String("/gitk"); + // If git/bin is in path, use 'wish' shell to run. Otherwise (git/cmd), directly run gitk + QString wish = gitBinDirectory + QLatin1String("/wish"); + if (QFileInfo(wish + QLatin1String(".exe")).exists()) { + arguments << binary; + binary = wish; + } } VcsBase::VcsBaseOutputWindow *outwin = VcsBase::VcsBaseOutputWindow::instance(); const QString gitkOpts = settings()->stringValue(GitSettings::gitkOptionsKey);