Commit 6a87d8d3 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

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: default avatarPetar Perisin <petar.perisin@gmail.com>
parent 3533ad2b
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment