Git: Cancel adding a branch if the git operation fails

e.g. If a branch with the chosen name already exists

Change-Id: I22be3001ed68d6bf6f45d9180ad60403267d4ad9
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
This commit is contained in:
Orgad Shaneh
2013-08-15 22:27:45 +03:00
committed by Orgad Shaneh
parent 3533ad2b48
commit 6a87d8d347

View File

@@ -160,6 +160,8 @@ void BranchDialog::add()
if (branchAddDialog.exec() == QDialog::Accepted && m_model) {
QModelIndex idx = m_model->addBranch(branchAddDialog.branchName(), branchAddDialog.track(), trackedIndex);
if (!idx.isValid())
return;
m_ui->branchView->selectionModel()->select(idx, QItemSelectionModel::Clear
| QItemSelectionModel::Select
| QItemSelectionModel::Current);