diff --git a/src/plugins/git/gerrit/gerritpushdialog.cpp b/src/plugins/git/gerrit/gerritpushdialog.cpp index a8986774d1f..b088367ded9 100644 --- a/src/plugins/git/gerrit/gerritpushdialog.cpp +++ b/src/plugins/git/gerrit/gerritpushdialog.cpp @@ -119,6 +119,15 @@ void GerritPushDialog::initRemoteBranches() m_remoteBranches.insertMulti(ref.left(refBranchIndex), bd); } QStringList remotes = m_client->synchronousRemotesList(m_workingDir).keys(); + remotes.removeDuplicates(); + { + const QString origin = QLatin1String("origin"); + const QString gerrit = QLatin1String("gerrit"); + if (remotes.removeOne(origin)) + remotes.prepend(origin); + if (remotes.removeOne(gerrit)) + remotes.prepend(gerrit); + } m_ui->remoteComboBox->addItems(remotes); m_ui->remoteComboBox->setEnabled(remotes.count() > 1); }