Commit e163356f authored by Petar Perisin's avatar Petar Perisin
Browse files

Git: Branches dialog - ensure all documents are saved



Change-Id: Ia48157b10fb2f9eb3a8b9b8e7e541a736dd75b4f
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 86e3d5af
......@@ -40,6 +40,7 @@
#include <utils/qtcassert.h>
#include <utils/execmenu.h>
#include <vcsbase/vcsbaseoutputwindow.h>
#include <coreplugin/documentmanager.h>
#include <QAction>
#include <QItemSelectionModel>
......@@ -177,6 +178,8 @@ void BranchDialog::add()
void BranchDialog::checkout()
{
if (!Core::DocumentManager::saveAllModifiedDocuments())
return;
QModelIndex idx = selectedIndex();
const QString currentBranch = m_model->fullName(m_model->currentBranch());
......@@ -319,6 +322,8 @@ void BranchDialog::log()
void BranchDialog::merge()
{
if (!Core::DocumentManager::saveAllModifiedDocuments())
return;
QModelIndex idx = selectedIndex();
QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled!
......@@ -340,6 +345,8 @@ void BranchDialog::merge()
void BranchDialog::rebase()
{
if (!Core::DocumentManager::saveAllModifiedDocuments())
return;
QModelIndex idx = selectedIndex();
QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled!
......@@ -351,6 +358,8 @@ void BranchDialog::rebase()
void BranchDialog::cherryPick()
{
if (!Core::DocumentManager::saveAllModifiedDocuments())
return;
QModelIndex idx = selectedIndex();
QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled!
......
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