forked from qt-creator/qt-creator
Gerrit: Inline two functions that are used just once
Change-Id: Iad49a785353203585342b61016df34105bc3a22e Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "gerritparameters.h"
|
||||
#include "gerritplugin.h"
|
||||
#include "../gitclient.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<GerritChange> &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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user