From fe1f7e4bf64f783f5c66cb5da2e2f2112e50d92c Mon Sep 17 00:00:00 2001 From: Petar Perisin Date: Tue, 2 Apr 2013 15:07:30 +0300 Subject: [PATCH] Gerrit: Added pushToGerrit dialog Change-Id: Ic16eae2def11343ef7be5ce8378d24b5fd11a386 Reviewed-by: Petar Perisin Reviewed-by: Orgad Shaneh Reviewed-by: Friedemann Kleint Reviewed-by: Tobias Hunger --- src/plugins/git/gerrit/gerrit.pri | 8 +- src/plugins/git/gerrit/gerritplugin.cpp | 52 +++++ src/plugins/git/gerrit/gerritplugin.h | 16 ++ src/plugins/git/gerrit/gerritpushdialog.cpp | 203 ++++++++++++++++++++ src/plugins/git/gerrit/gerritpushdialog.h | 72 +++++++ src/plugins/git/gerrit/gerritpushdialog.ui | 162 ++++++++++++++++ src/plugins/git/git.qbs | 3 + src/plugins/git/gitclient.cpp | 40 +++- src/plugins/git/gitclient.h | 7 +- src/plugins/git/gitplugin.cpp | 10 +- src/plugins/git/gitplugin.h | 6 + src/plugins/git/remotedialog.cpp | 3 +- 12 files changed, 567 insertions(+), 15 deletions(-) create mode 100644 src/plugins/git/gerrit/gerritpushdialog.cpp create mode 100644 src/plugins/git/gerrit/gerritpushdialog.h create mode 100644 src/plugins/git/gerrit/gerritpushdialog.ui diff --git a/src/plugins/git/gerrit/gerrit.pri b/src/plugins/git/gerrit/gerrit.pri index 8d49ad8d923..b06518ec5b2 100644 --- a/src/plugins/git/gerrit/gerrit.pri +++ b/src/plugins/git/gerrit/gerrit.pri @@ -4,10 +4,14 @@ SOURCES += $$PWD/gerritdialog.cpp \ $$PWD/gerritmodel.cpp \ $$PWD/gerritparameters.cpp \ $$PWD/gerritplugin.cpp \ - $$PWD/gerritoptionspage.cpp + $$PWD/gerritoptionspage.cpp \ + $$PWD/gerritpushdialog.cpp HEADERS += $$PWD/gerritdialog.h \ $$PWD/gerritmodel.h \ $$PWD/gerritparameters.h \ $$PWD/gerritplugin.h \ - $$PWD/gerritoptionspage.h + $$PWD/gerritoptionspage.h \ + $$PWD/gerritpushdialog.h + +FORMS += $$PWD/gerritpushdialog.ui diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp index 40237230798..2337781d64f 100644 --- a/src/plugins/git/gerrit/gerritplugin.cpp +++ b/src/plugins/git/gerrit/gerritplugin.cpp @@ -32,6 +32,7 @@ #include "gerritdialog.h" #include "gerritmodel.h" #include "gerritoptionspage.h" +#include "gerritpushdialog.h" #include "../gitplugin.h" #include "../gitclient.h" @@ -50,6 +51,7 @@ #include #include #include +#include #include @@ -70,6 +72,7 @@ enum { debug = 0 }; namespace Gerrit { namespace Constants { const char GERRIT_OPEN_VIEW[] = "Gerrit.OpenView"; +const char GERRIT_PUSH[] = "Gerrit.Push"; } namespace Internal { @@ -332,10 +335,59 @@ bool GerritPlugin::initialize(Core::ActionContainer *ac) connect(openViewAction, SIGNAL(triggered()), this, SLOT(openView())); ac->addAction(command); + QAction *pushAction = new QAction(tr("Push to Gerrit..."), this); + + Core::Command *pushCommand = + Core::ActionManager::registerAction(pushAction, Constants::GERRIT_PUSH, + Core::Context(Core::Constants::C_GLOBAL)); + connect(pushAction, SIGNAL(triggered()), this, SLOT(push())); + ac->addAction(pushCommand); + + m_pushToGerritPair = ActionCommandPair(pushAction, pushCommand); + Git::Internal::GitPlugin::instance()->addAutoReleasedObject(new GerritOptionsPage(m_parameters)); return true; } +void GerritPlugin::updateActions(bool hasTopLevel) +{ + m_pushToGerritPair.first->setEnabled(hasTopLevel); +} + +void GerritPlugin::addToLocator(Locator::CommandLocator *locator) +{ + locator->appendCommand(m_pushToGerritPair.second); +} + +void GerritPlugin::push() +{ + const QString topLevel = Git::Internal::GitPlugin::instance()->currentState().topLevel(); + + QPointer dialog = new GerritPushDialog(topLevel, Core::ICore::mainWindow()); + + if (!dialog->localChangesFound()) { + QMessageBox::critical(Core::ICore::mainWindow(), tr("No Local Changes"), + tr("Change from HEAD appears to be in remote branch already! Aborting.")); + return; + } + + if (dialog->exec() == QDialog::Rejected) + return; + + if (dialog.isNull()) + return; + + QStringList args; + + args << dialog->selectedRemoteName(); + args << QLatin1String("HEAD:refs/") + dialog->selectedPushType() + + QLatin1Char('/') + dialog->selectedRemoteBranchName(); + + Git::Internal::GitPlugin::instance()->gitClient()->synchronousPush(topLevel, args); + + delete dialog; +} + // Open or raise the Gerrit dialog window. void GerritPlugin::openView() { diff --git a/src/plugins/git/gerrit/gerritplugin.h b/src/plugins/git/gerrit/gerritplugin.h index 0e0109b1f60..98478a8b25f 100644 --- a/src/plugins/git/gerrit/gerritplugin.h +++ b/src/plugins/git/gerrit/gerritplugin.h @@ -33,9 +33,19 @@ #include #include #include +#include + +QT_BEGIN_NAMESPACE +class QAction; +QT_END_NAMESPACE namespace Core { class ActionContainer; +class Command; +} + +namespace Locator { + class CommandLocator; } namespace Gerrit { @@ -45,6 +55,8 @@ class GerritChange; class GerritParameters; class GerritDialog; +typedef QPair ActionCommandPair; + class GerritPlugin : public QObject { Q_OBJECT @@ -56,11 +68,13 @@ public: static QString gitBinary(); static QString branch(const QString &repository); + void addToLocator(Locator::CommandLocator *locator); public slots: void fetchDisplay(const QSharedPointer &change); void fetchApply(const QSharedPointer &change); void fetchCheckout(const QSharedPointer &change); + void updateActions(bool hasTopLevel); signals: void fetchStarted(const QSharedPointer &change); @@ -68,6 +82,7 @@ signals: private slots: void openView(); + void push(); private: QString findLocalRepository(QString project, const QString &branch) const; @@ -75,6 +90,7 @@ private: QSharedPointer m_parameters; QPointer m_dialog; + ActionCommandPair m_pushToGerritPair; }; } // namespace Internal diff --git a/src/plugins/git/gerrit/gerritpushdialog.cpp b/src/plugins/git/gerrit/gerritpushdialog.cpp new file mode 100644 index 00000000000..6f595c743c0 --- /dev/null +++ b/src/plugins/git/gerrit/gerritpushdialog.cpp @@ -0,0 +1,203 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Petar Perisin. +** Contact: petar.perisin@gmail.com +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#include "gerritpushdialog.h" +#include "ui_gerritpushdialog.h" + +#include "../gitplugin.h" +#include "../gitclient.h" +#include + +#include +#include + +namespace Gerrit { +namespace Internal { + +GerritPushDialog::GerritPushDialog(const QString &workingDir, QWidget *parent) : + QDialog(parent), + m_workingDir(workingDir), + m_ui(new Ui::GerritPushDialog), + m_remoteBranches(new QMap()), + m_localChangesFound(true) +{ + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + m_ui->setupUi(this); + m_ui->repositoryLabel->setText(tr("Local Repository: %1").arg( + QDir::toNativeSeparators(workingDir))); + + Git::Internal::GitClient *gitClient = Git::Internal::GitPlugin::instance()->gitClient(); + QString output; + QString error; + QStringList args; + + args << QLatin1String("--no-color") << QLatin1String("--format=%P") + << QLatin1String("HEAD") << QLatin1String("--not")<< QLatin1String("--remotes"); + + if (!gitClient->synchronousLog(m_workingDir, args, &output) || output.isEmpty()) + reject(); + + output.chop(1); + if (output.isEmpty()) { + output = QLatin1String("HEAD"); + m_localChangesFound = false; + } else { + output = output.mid(output.lastIndexOf(QLatin1Char('\n')) + 1); + } + + args.clear(); + args << QLatin1String("--remotes") << QLatin1String("--contains") << output; + + if (!gitClient->synchronousBranchCmd(m_workingDir, args, &output, &error)) + reject(); + + QString head = QLatin1String("/HEAD"); + QStringList refs = output.split(QLatin1Char('\n')); + foreach (const QString &reference, refs) { + if (reference.contains(head) || reference.isEmpty()) + continue; + + m_suggestedRemoteName = reference.left(reference.indexOf(QLatin1Char('/'))).trimmed(); + m_suggestedRemoteBranch = reference.mid(reference.indexOf(QLatin1Char('/')) + 1).trimmed(); + break; + } + + output.clear(); + error.clear(); + args.clear(); + + args << QLatin1String("--remotes"); + + if (!gitClient->synchronousBranchCmd(m_workingDir, args, &output, &error)) + reject(); + + refs.clear(); + refs = output.split(QLatin1String("\n")); + foreach (const QString &reference, refs) { + if (reference.contains(head) || reference.isEmpty()) + continue; + + int refBranchIndex = reference.indexOf(QLatin1Char('/')); + m_remoteBranches->insertMulti(reference.left(refBranchIndex).trimmed(), + reference.mid(refBranchIndex + 1).trimmed()); + } + + int currIndex = 0; + QStringList remotes = m_remoteBranches->keys(); + remotes.removeDuplicates(); + foreach (const QString &remote, remotes) { + m_ui->remoteComboBox->addItem(remote); + if (remote == m_suggestedRemoteName) + m_ui->remoteComboBox->setCurrentIndex(currIndex); + ++currIndex; + } + if (m_ui->remoteComboBox->count() < 1) + reject(); + + m_ui->remoteComboBox->setEnabled(m_ui->remoteComboBox->count() != 1); + + connect(m_ui->remoteComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setRemoteBranches())); + connect(m_ui->branchComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setChangeRange())); + setRemoteBranches(); +} + +GerritPushDialog::~GerritPushDialog() +{ + delete m_ui; + delete m_remoteBranches; +} + + +QString GerritPushDialog::calculateChangeRange() +{ + QString remote = selectedRemoteName(); + remote += QLatin1Char('/'); + remote += selectedRemoteBranchName(); + + QStringList args(remote + QLatin1String("..HEAD")); + args << QLatin1String("--count"); + + QString number; + + if (!Git::Internal::GitPlugin::instance()->gitClient()-> + synchronousRevListCmd(m_workingDir, args, &number)) + reject(); + + number.chop(1); + return number; +} + +void GerritPushDialog::setChangeRange() +{ + QString remote = selectedRemoteName(); + remote += QLatin1Char('/'); + remote += selectedRemoteBranchName(); + m_ui->infoLabel->setText(tr("Number of commits between HEAD and %1: %2").arg( + remote, calculateChangeRange())); +} + +bool GerritPushDialog::localChangesFound() const +{ + return m_localChangesFound; +} + +void GerritPushDialog::setRemoteBranches() +{ + m_ui->branchComboBox->clear(); + + QMap::const_iterator it; + int i = 0; + for (it = m_remoteBranches->constBegin(); it != m_remoteBranches->constEnd(); ++it) { + if (it.key() == selectedRemoteName()) { + m_ui->branchComboBox->addItem(it.value()); + if (it.value() == m_suggestedRemoteBranch) + m_ui->branchComboBox->setCurrentIndex(i); + ++i; + } + } + setChangeRange(); +} + +QString GerritPushDialog::selectedRemoteName() const +{ + return m_ui->remoteComboBox->currentText(); +} + +QString GerritPushDialog::selectedRemoteBranchName() const +{ + return m_ui->branchComboBox->currentText(); +} + +QString GerritPushDialog::selectedPushType() const +{ + return m_ui->publicRadioButton->isChecked() ? QLatin1String("for") : QLatin1String("draft"); +} + +} // namespace Internal +} // namespace Gerrit diff --git a/src/plugins/git/gerrit/gerritpushdialog.h b/src/plugins/git/gerrit/gerritpushdialog.h new file mode 100644 index 00000000000..6de9aff5c1e --- /dev/null +++ b/src/plugins/git/gerrit/gerritpushdialog.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Petar Perisin. +** Contact: petar.perisin@gmail.com +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#ifndef GERRITPUSHDIALOG_H +#define GERRITPUSHDIALOG_H + +#include + +namespace Gerrit { +namespace Internal { + +namespace Ui { + class GerritPushDialog; +} + +class GerritPushDialog : public QDialog +{ + Q_OBJECT + +public: + GerritPushDialog(const QString &workingDir, QWidget *parent = 0); + ~GerritPushDialog(); + + QString selectedRemoteName() const; + QString selectedRemoteBranchName() const; + QString selectedPushType() const; + bool localChangesFound() const; + +private slots: + void setChangeRange(); + void setRemoteBranches(); + +private: + QString calculateChangeRange(); + QString m_workingDir; + QString m_suggestedRemoteName; + QString m_suggestedRemoteBranch; + Ui::GerritPushDialog *m_ui; + QMap *m_remoteBranches; + bool m_localChangesFound; +}; + + +} // namespace Internal +} // namespace Gerrit +#endif // GERRITPUSHDIALOG_H diff --git a/src/plugins/git/gerrit/gerritpushdialog.ui b/src/plugins/git/gerrit/gerritpushdialog.ui new file mode 100644 index 00000000000..2a358ecd7ee --- /dev/null +++ b/src/plugins/git/gerrit/gerritpushdialog.ui @@ -0,0 +1,162 @@ + + + Gerrit::Internal::GerritPushDialog + + + + 0 + 0 + 306 + 304 + + + + Push to Gerrit + + + + + + 10 + + + 3 + + + 3 + + + 3 + + + + + Local Repository: + + + + + + + + + Push Type: + + + + + + Public + + + true + + + + + + + Draft + + + + + + + + + + Remote Branch: + + + + + + + + + Remote Name: + + + + + + + Branch Name: + + + + + + + + + + + + + Number of commits + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + Gerrit::Internal::GerritPushDialog + accept() + + + 227 + 330 + + + 157 + 274 + + + + + buttonBox + rejected() + Gerrit::Internal::GerritPushDialog + reject() + + + 295 + 336 + + + 286 + 274 + + + + + diff --git a/src/plugins/git/git.qbs b/src/plugins/git/git.qbs index 2f92f3154ba..95fa416ea2e 100644 --- a/src/plugins/git/git.qbs +++ b/src/plugins/git/git.qbs @@ -107,6 +107,9 @@ QtcPlugin { "gerritparameters.h", "gerritplugin.cpp", "gerritplugin.h", + "gerritpushdialog.cpp", + "gerritpushdialog.h", + "gerritpushdialog.ui", ] } } diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index cf17d2db032..c33282cda13 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1121,6 +1121,29 @@ static inline bool splitCommitParents(const QString &line, return true; } +bool GitClient::synchronousRevListCmd(const QString &workingDirectory, const QStringList &arguments, + QString *output, QString *errorMessage) +{ + QByteArray outputTextData; + QByteArray errorText; + + QStringList args(QLatin1String("rev-list")); + args += arguments; + + const bool rc = fullySynchronousGit(workingDirectory, args, &outputTextData, &errorText); + if (!rc) { + if (errorMessage) + *errorMessage = commandOutputFromLocal8Bit(errorText); + else + outputWindow()->append(tr("Cannot execute \"git %1\" in \"%2\": %3").arg( + args.join(QLatin1String(" ")), workingDirectory, + commandOutputFromLocal8Bit(errorText))); + return false; + } + *output = commandOutputFromLocal8Bit(outputTextData); + return true; +} + // Find out the immediate parent revisions of a revision of the repository. // Might be several in case of merges. bool GitClient::synchronousParentRevisions(const QString &workingDirectory, @@ -1129,8 +1152,8 @@ bool GitClient::synchronousParentRevisions(const QString &workingDirectory, QStringList *parents, QString *errorMessage) { - QByteArray outputTextData; - QByteArray errorText; + QString outputText; + QString errorText; QStringList arguments; if (parents && !isValidRevision(revision)) { // Not Committed Yet *parents = QStringList(QLatin1String("HEAD")); @@ -1142,14 +1165,13 @@ bool GitClient::synchronousParentRevisions(const QString &workingDirectory, arguments.append(QLatin1String("--")); arguments.append(files); } - const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputTextData, &errorText); - if (!rc) { - *errorMessage = msgParentRevisionFailed(workingDirectory, revision, commandOutputFromLocal8Bit(errorText)); + + if (!synchronousRevListCmd(workingDirectory, arguments, &outputText, &errorText)) { + *errorMessage = msgParentRevisionFailed(workingDirectory, revision, errorText); return false; } // Should result in one line of blank-delimited revisions, specifying current first // unless it is top. - QString outputText = commandOutputFromLocal8Bit(outputTextData); outputText.remove(QLatin1Char('\n')); if (!splitCommitParents(outputText, 0, parents)) { *errorMessage = msgParentRevisionFailed(workingDirectory, revision, msgInvalidRevision()); @@ -2487,14 +2509,14 @@ void GitClient::subversionLog(const QString &workingDirectory) executeGit(workingDirectory, arguments, editor); } -bool GitClient::synchronousPush(const QString &workingDirectory, const QString &remote) +bool GitClient::synchronousPush(const QString &workingDirectory, const QStringList &pushArgs) { // Disable UNIX terminals to suppress SSH prompting. const unsigned flags = VcsBase::VcsBasePlugin::SshPasswordPrompt|VcsBase::VcsBasePlugin::ShowStdOutInLogWindow |VcsBase::VcsBasePlugin::ShowSuccessMessage; QStringList arguments(QLatin1String("push")); - if (!remote.isEmpty()) - arguments << remote; + if (!pushArgs.isEmpty()) + arguments += pushArgs; const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory, arguments, flags); return resp.result == Utils::SynchronousProcessResponse::Finished; diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index ef8cd3d0ff9..04292fca76b 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -189,6 +189,10 @@ public: QString *errorMessage = 0); bool synchronousShow(const QString &workingDirectory, const QString &id, QString *output, QString *errorMessage); + + bool synchronousRevListCmd(const QString &workingDirectory, const QStringList &arguments, + QString *output, QString *errorMessage = 0); + bool synchronousParentRevisions(const QString &workingDirectory, const QStringList &files /* = QStringList() */, const QString &revision, @@ -208,7 +212,8 @@ public: QString vcsGetRepositoryURL(const QString &directory); bool synchronousFetch(const QString &workingDirectory, const QString &remote); bool synchronousPull(const QString &workingDirectory, bool rebase); - bool synchronousPush(const QString &workingDirectory, const QString &remote = QString()); + bool synchronousPush(const QString &workingDirectory, + const QStringList &pushArgs = QStringList()); bool synchronousMerge(const QString &workingDirectory, const QString &branch); bool canRebase(const QString &workingDirectory) const; bool synchronousRebase(const QString &workingDirectory, diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 223707a500e..e02081db6c4 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -623,8 +623,12 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) /* "Gerrit" */ - Gerrit::Internal::GerritPlugin *gp = new Gerrit::Internal::GerritPlugin(this); - return gp->initialize(remoteRepositoryMenu); + m_gerritPlugin = new Gerrit::Internal::GerritPlugin(this); + const bool ok = m_gerritPlugin->initialize(remoteRepositoryMenu); + m_gerritPlugin->updateActions(currentState().hasTopLevel()); + m_gerritPlugin->addToLocator(m_commandLocator); + + return ok; } GitVersionControl *GitPlugin::gitVersionControl() const @@ -1245,6 +1249,8 @@ void GitPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as) m_submoduleUpdateAction->setVisible(repositoryEnabled && QFile::exists(currentState().topLevel() + QLatin1String("/.gitmodules"))); updateRepositoryBrowserAction(); + + m_gerritPlugin->updateActions(repositoryEnabled); } void GitPlugin::updateRepositoryBrowserAction() diff --git a/src/plugins/git/gitplugin.h b/src/plugins/git/gitplugin.h index 02b8f7903b8..00a032603a4 100644 --- a/src/plugins/git/gitplugin.h +++ b/src/plugins/git/gitplugin.h @@ -63,6 +63,11 @@ class ParameterAction; namespace Locator { class CommandLocator; } +namespace Gerrit { +namespace Internal { +class GerritPlugin; +} +} namespace Git { namespace Internal { @@ -211,6 +216,7 @@ private: QVector m_projectActions; QVector m_repositoryActions; Utils::ParameterAction *m_applyCurrentFilePatchAction; + Gerrit::Internal::GerritPlugin *m_gerritPlugin; GitClient *m_gitClient; QPointer m_stashDialog; diff --git a/src/plugins/git/remotedialog.cpp b/src/plugins/git/remotedialog.cpp index 780995d86d6..05006dbb153 100644 --- a/src/plugins/git/remotedialog.cpp +++ b/src/plugins/git/remotedialog.cpp @@ -174,7 +174,8 @@ void RemoteDialog::pushToRemote() const int row = indexList.at(0).row(); const QString remoteName = m_remoteModel->remoteName(row); - m_remoteModel->client()->synchronousPush(m_remoteModel->workingDirectory(), remoteName); + m_remoteModel->client()->synchronousPush(m_remoteModel->workingDirectory(), + QStringList() << remoteName); } void RemoteDialog::fetchFromRemote()