forked from qt-creator/qt-creator
Git: Store singleton instance in GitClient
On many cases, GitPlugin is not required at all, and is only used as a proxy for GitClient. Change-Id: I246012658ab3e8c7a12f1a459b1b1748ff358e0b Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
5765bd8507
commit
7c4f0a9b1e
@@ -24,7 +24,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "branchcombobox.h"
|
||||
#include "../gitplugin.h"
|
||||
#include "../gitclient.h"
|
||||
|
||||
using namespace Git::Internal;
|
||||
@@ -36,7 +35,7 @@ BranchComboBox::BranchComboBox(QWidget *parent) : QComboBox(parent)
|
||||
void BranchComboBox::init(const QString &repository)
|
||||
{
|
||||
m_repository = repository;
|
||||
QString currentBranch = GitPlugin::client()->synchronousCurrentLocalBranch(repository);
|
||||
QString currentBranch = GitClient::instance()->synchronousCurrentLocalBranch(repository);
|
||||
if (currentBranch.isEmpty()) {
|
||||
m_detached = true;
|
||||
currentBranch = "HEAD";
|
||||
@@ -44,7 +43,7 @@ void BranchComboBox::init(const QString &repository)
|
||||
}
|
||||
QString output;
|
||||
const QString branchPrefix("refs/heads/");
|
||||
if (!GitPlugin::client()->synchronousForEachRefCmd(
|
||||
if (!GitClient::instance()->synchronousForEachRefCmd(
|
||||
m_repository, {"--format=%(refname)", branchPrefix}, &output)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user