summaryrefslogtreecommitdiff
path: root/src/plugins/git/gitplugin.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2013-07-05 17:37:58 +0300
committerOrgad Shaneh <orgads@gmail.com>2013-07-08 13:21:41 +0200
commitaad68917b92f1dee4f09c9c4b0d102f04558b39c (patch)
treebc7680f3c931870fcda1a6894323392a00c115a6 /src/plugins/git/gitplugin.cpp
parent8aa1c9bc37dd060b188b4e6389b5c8063f8754d8 (diff)
downloadqt-creator-aad68917b92f1dee4f09c9c4b0d102f04558b39c.tar.gz
Git: Always allow stash before cherry-pick/revert
Currently done only from "Actions on Commits" Change-Id: Ide34e198e72f554ba6fd75ef21aaaf35917b4f6a Reviewed-by: Petar Perisin <petar.perisin@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/git/gitplugin.cpp')
-rw-r--r--src/plugins/git/gitplugin.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index 917a47a39c..450a0ddf94 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -857,28 +857,23 @@ void GitPlugin::startChangeRelatedAction()
if (!ensureAllDocumentsSaved())
return;
- QString command;
bool (GitClient::*commandFunction)(const QString&, const QString&);
switch (dialog.command()) {
case CherryPick:
- command = QLatin1String("Cherry-pick");
commandFunction = &GitClient::synchronousCherryPick;
break;
case Revert:
- command = QLatin1String("Revert");
commandFunction = &GitClient::synchronousRevert;
break;
case Checkout:
- command = QLatin1String("Checkout");
+ if (!m_gitClient->beginStashScope(workingDirectory, QLatin1String("Checkout")))
+ return;
commandFunction = &GitClient::synchronousCheckout;
break;
default:
return;
}
- if (!m_gitClient->beginStashScope(workingDirectory, command))
- return;
-
(m_gitClient->*commandFunction)(workingDirectory, change);
}