diff options
author | Eike Ziller <eike.ziller@digia.com> | 2013-07-18 11:54:02 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2013-07-18 11:54:02 +0200 |
commit | 556360487687042f018c8ce985d457a50711b359 (patch) | |
tree | b94173cfe4aee1f42e2626104bdbc0734438399b /src/plugins/git/branchdialog.cpp | |
parent | 7b4895d7ec9c04df01837bbcbdd77779dd091cf7 (diff) | |
parent | 35211c04b1ad643f34dfc8ae7c9b1a330cb4ed2b (diff) | |
download | qt-creator-556360487687042f018c8ce985d457a50711b359.tar.gz |
Merge remote-tracking branch 'origin/2.8' into HEAD
Diffstat (limited to 'src/plugins/git/branchdialog.cpp')
-rw-r--r-- | src/plugins/git/branchdialog.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/plugins/git/branchdialog.cpp b/src/plugins/git/branchdialog.cpp index 979a3b9004..55305addd8 100644 --- a/src/plugins/git/branchdialog.cpp +++ b/src/plugins/git/branchdialog.cpp @@ -198,15 +198,17 @@ void BranchDialog::checkout() m_model->checkoutBranch(idx); } else if (branchCheckoutDialog.exec() == QDialog::Accepted && m_model) { - QString stashMessage; - if (branchCheckoutDialog.makeStashOfCurrentBranch() - || branchCheckoutDialog.moveLocalChangesToNextBranch()) { - - if (!gitClient->beginStashScope(m_repository, currentBranch + QLatin1String("-AutoStash"), NoPrompt)) + if (branchCheckoutDialog.makeStashOfCurrentBranch()) { + if (!gitClient->executeSynchronousStash(m_repository, + currentBranch + QLatin1String("-AutoStash"))) { + return; + } + } else if (branchCheckoutDialog.moveLocalChangesToNextBranch()) { + if (!gitClient->beginStashScope(m_repository, QLatin1String("Checkout"), NoPrompt)) return; - stashMessage = gitClient->stashInfo(m_repository).stashMessage(); } else if (branchCheckoutDialog.discardLocalChanges()) { - gitClient->synchronousReset(m_repository); + if (!gitClient->synchronousReset(m_repository)) + return; } m_model->checkoutBranch(idx); @@ -220,7 +222,7 @@ void BranchDialog::checkout() } } - if (!stashMessage.isEmpty() && branchCheckoutDialog.moveLocalChangesToNextBranch()) + if (branchCheckoutDialog.moveLocalChangesToNextBranch()) gitClient->endStashScope(m_repository); else if (branchCheckoutDialog.popStashOfNextBranch()) gitClient->synchronousStashRestore(m_repository, stashName, true); |