Git: Add git bash to tools menu

Can be useful to perform tasks that don't have
a dedicated UI in Creator.

In my setup, git bash was directly in the git
installation folder %ProgramFiles%\Git and
therefore one level above git.exe itself.

Change-Id: I1ca0d3439690170d7fb840bca17e2c412effe0a4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2020-04-29 18:10:00 +02:00
committed by André Hartmann
parent 97165f0cb8
commit f486ff7dab
3 changed files with 35 additions and 0 deletions

View File

@@ -2537,6 +2537,24 @@ FilePath GitClient::gitBinDirectory() const
return FilePath::fromString(path);
}
bool GitClient::launchGitBash(const QString &workingDirectory)
{
bool success = true;
const QString git = vcsBinary().toString();
if (git.isEmpty()) {
success = false;
} else {
const QString gitBash = QFileInfo(git).absolutePath() + "/../git-bash.exe";
success = QProcess::startDetached(gitBash, {}, workingDirectory);
}
if (!success)
VcsOutputWindow::appendError(msgCannotLaunch("git-bash"));
return success;
}
FilePath GitClient::vcsBinary() const
{
bool ok;