forked from qt-creator/qt-creator
Git: Suppress "No local commits" error message in Push to Gerrit
Change-Id: Ib0cf79acf48d24848fda92a8b7b06efe62b46dbc Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
b7d2268ff3
commit
635a355f97
@@ -254,7 +254,8 @@ void GerritPushDialog::setRemoteBranches(bool includeOld)
|
||||
void GerritPushDialog::updateCommits(int index)
|
||||
{
|
||||
const QString branch = m_ui->localBranchComboBox->itemText(index);
|
||||
const bool hasLocalCommits = m_ui->commitView->init(m_workingDir, branch);
|
||||
const bool hasLocalCommits = m_ui->commitView->init(m_workingDir, branch,
|
||||
LogChangeWidget::Silent);
|
||||
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(hasLocalCommits);
|
||||
setChangeRange();
|
||||
}
|
||||
|
||||
@@ -78,12 +78,13 @@ bool LogChangeWidget::init(const QString &repository, const QString &commit, Log
|
||||
{
|
||||
if (!populateLog(repository, commit, flags))
|
||||
return false;
|
||||
if (!m_model->rowCount()) {
|
||||
if (m_model->rowCount() > 0)
|
||||
return true;
|
||||
if (!(flags & Silent)) {
|
||||
VcsBaseOutputWindow::instance()->appendError(
|
||||
GitPlugin::instance()->gitClient()->msgNoCommits(flags & IncludeRemotes));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
QString LogChangeWidget::commit() const
|
||||
|
||||
@@ -56,7 +56,8 @@ public:
|
||||
enum LogFlag
|
||||
{
|
||||
None = 0x00,
|
||||
IncludeRemotes = 0x01
|
||||
IncludeRemotes = 0x01,
|
||||
Silent = 0x02
|
||||
};
|
||||
|
||||
Q_DECLARE_FLAGS(LogFlags, LogFlag)
|
||||
|
||||
Reference in New Issue
Block a user