summaryrefslogtreecommitdiff
path: root/src/plugins/git/branchdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/git/branchdialog.cpp')
-rw-r--r--src/plugins/git/branchdialog.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/plugins/git/branchdialog.cpp b/src/plugins/git/branchdialog.cpp
index 2c7dca4b28..e57ff1bd0f 100644
--- a/src/plugins/git/branchdialog.cpp
+++ b/src/plugins/git/branchdialog.cpp
@@ -189,14 +189,9 @@ void BranchDialog::checkout()
if (branchCheckoutDialog.makeStashOfCurrentBranch()
|| branchCheckoutDialog.moveLocalChangesToNextBranch()) {
- GitClient::StashGuard stashGuard(m_repository,
- currentBranch + QLatin1String("-AutoStash"),
- NoPrompt);
- if (stashGuard.stashingFailed())
+ if (!gitClient->beginStashScope(m_repository, currentBranch + QLatin1String("-AutoStash"), NoPrompt))
return;
- stashGuard.preventPop();
- stashMessage = stashGuard.stashMessage();
-
+ stashMessage = gitClient->stashInfo(m_repository).stashMessage();
} else if (branchCheckoutDialog.discardLocalChanges()) {
gitClient->synchronousReset(m_repository);
}
@@ -295,9 +290,9 @@ void BranchDialog::merge()
QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled!
const QString branch = m_model->branchName(idx);
- GitClient::StashGuard stashGuard(m_repository, QLatin1String("merge"), AllowUnstashed);
- if (!GitPlugin::instance()->gitClient()->synchronousMerge(m_repository, branch))
- stashGuard.preventPop();
+ GitClient *client = GitPlugin::instance()->gitClient();
+ if (client->beginStashScope(m_repository, QLatin1String("merge"), AllowUnstashed))
+ client->synchronousMerge(m_repository, branch);
}
void BranchDialog::rebase()
@@ -307,9 +302,9 @@ void BranchDialog::rebase()
QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled!
const QString baseBranch = m_model->branchName(idx);
- GitClient::StashGuard stashGuard(m_repository, QLatin1String("rebase"));
- if (!GitPlugin::instance()->gitClient()->synchronousRebase(m_repository, baseBranch))
- stashGuard.preventPop();
+ GitClient *client = GitPlugin::instance()->gitClient();
+ if (client->beginStashScope(m_repository, QLatin1String("rebase")))
+ client->synchronousRebase(m_repository, baseBranch);
}
QModelIndex BranchDialog::selectedIndex()