forked from qt-creator/qt-creator
Git: Trim change on ChangeSelectionDialog
When a ref is copied from an external source (e.g. gerrit), it might includes a trailing whitespace. Change-Id: I61305af27959f457795afa37654e683622d38259 Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
746da71527
commit
aeab5d9ab9
@@ -88,7 +88,7 @@ ChangeSelectionDialog::~ChangeSelectionDialog()
|
|||||||
|
|
||||||
QString ChangeSelectionDialog::change() const
|
QString ChangeSelectionDialog::change() const
|
||||||
{
|
{
|
||||||
return m_ui->changeNumberEdit->text();
|
return m_ui->changeNumberEdit->text().trimmed();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChangeSelectionDialog::selectCommitFromRecentHistory()
|
void ChangeSelectionDialog::selectCommitFromRecentHistory()
|
||||||
@@ -210,14 +210,14 @@ void ChangeSelectionDialog::recalculateDetails()
|
|||||||
m_ui->workingDirectoryEdit->setPalette(palette);
|
m_ui->workingDirectoryEdit->setPalette(palette);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString change = m_ui->changeNumberEdit->text();
|
const QString ref = change();
|
||||||
if (change.isEmpty()) {
|
if (ref.isEmpty()) {
|
||||||
m_ui->detailsText->setPlainText(QString());
|
m_ui->detailsText->setPlainText(QString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("log") << QLatin1String("-n1") << change;
|
args << QLatin1String("log") << QLatin1String("-n1") << ref;
|
||||||
|
|
||||||
m_process = new QProcess(this);
|
m_process = new QProcess(this);
|
||||||
m_process->setWorkingDirectory(workingDir);
|
m_process->setWorkingDirectory(workingDir);
|
||||||
|
|||||||
Reference in New Issue
Block a user