diff --git a/src/plugins/git/gerrit/gerritparameters.cpp b/src/plugins/git/gerrit/gerritparameters.cpp index de02165011b..9d9eb24e482 100644 --- a/src/plugins/git/gerrit/gerritparameters.cpp +++ b/src/plugins/git/gerrit/gerritparameters.cpp @@ -3,6 +3,7 @@ #include "gerritparameters.h" #include "gerritplugin.h" +#include "../gitclient.h" #include @@ -40,7 +41,7 @@ static FilePath detectApp(const QString &defaultExe) if (!app.isEmpty() || !HostOsInfo::isWindowsHost()) return FilePath::fromString(app); // Windows: Use app.exe from git if it cannot be found. - const FilePath gitBinDir = GerritPlugin::gitBinDirectory(); + const FilePath gitBinDir = Git::Internal::gitClient().gitBinDirectory(); if (gitBinDir.isEmpty()) return {}; FilePath path = gitBinDir.pathAppended(defaultApp); diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp index 7e2a9790542..caaa59b09f3 100644 --- a/src/plugins/git/gerrit/gerritplugin.cpp +++ b/src/plugins/git/gerrit/gerritplugin.cpp @@ -39,12 +39,12 @@ using namespace Git::Internal; enum { debug = 0 }; -namespace Gerrit { +namespace Gerrit::Internal { + namespace Constants { const char GERRIT_OPEN_VIEW[] = "Gerrit.OpenView"; const char GERRIT_PUSH[] = "Gerrit.Push"; } -namespace Internal { enum FetchMode { @@ -263,17 +263,6 @@ void GerritPlugin::push() push(currentRepository()); } -Utils::FilePath GerritPlugin::gitBinDirectory() -{ - return gitClient().gitBinDirectory(); -} - -// Find the branch of a repository. -QString GerritPlugin::branch(const FilePath &repository) -{ - return gitClient().synchronousCurrentLocalBranch(repository); -} - void GerritPlugin::fetch(const std::shared_ptr &change, int mode) { // Locate git. @@ -385,7 +374,9 @@ FilePath GerritPlugin::findLocalRepository(const QString &project, const QString if (branch.isEmpty()) { return repository; } else { - const QString repositoryBranch = GerritPlugin::branch(repository); + // Find the branch of a repository. + const QString repositoryBranch = + gitClient().synchronousCurrentLocalBranch(repository); if (repositoryBranch.isEmpty() || repositoryBranch == branch) return repository; } // !branch.isEmpty() @@ -398,7 +389,6 @@ FilePath GerritPlugin::findLocalRepository(const QString &project, const QString return FilePath::currentWorkingPath(); } -} // namespace Internal -} // namespace Gerrit +} // Gerrit::Internal #include "gerritplugin.moc" diff --git a/src/plugins/git/gerrit/gerritplugin.h b/src/plugins/git/gerrit/gerritplugin.h index dd7ebde014f..42525d2480b 100644 --- a/src/plugins/git/gerrit/gerritplugin.h +++ b/src/plugins/git/gerrit/gerritplugin.h @@ -34,8 +34,6 @@ public: void addToMenu(Core::ActionContainer *ac); - static Utils::FilePath gitBinDirectory(); - static QString branch(const Utils::FilePath &repository); void addToLocator(Core::CommandLocator *locator); void push(const Utils::FilePath &topLevel);