summaryrefslogtreecommitdiff
path: root/src/plugins/git/gitplugin.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2013-10-02 15:14:26 +0300
committerOrgad Shaneh <orgads@gmail.com>2013-10-05 19:15:17 +0200
commit1f0cbbc807e76078771a58c7dc20705dd48b8c72 (patch)
tree9fe8963c595b89f1626d66dbb1c39d6cb9fe0f75 /src/plugins/git/gitplugin.cpp
parentc07eaa2a252a9e108155c0f14219119e6f80505f (diff)
downloadqt-creator-1f0cbbc807e76078771a58c7dc20705dd48b8c72.tar.gz
Git: Disallow Commit and Push if rebase is in progress
Change-Id: I35a6cf850bccf076d22a73b98b0422663c61b1d3 Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
Diffstat (limited to 'src/plugins/git/gitplugin.cpp')
-rw-r--r--src/plugins/git/gitplugin.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index 7d0f918c74..ab195cde66 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -1111,25 +1111,22 @@ bool GitPlugin::submitEditorAboutToClose()
commitType, amendSHA1,
m_commitMessageFileName, model);
}
- if (closeEditor) {
- cleanCommitMessageFile();
- if (commitType == FixupCommit) {
- if (!m_gitClient->beginStashScope(m_submitRepository, QLatin1String("Rebase-fixup"), NoPrompt))
- return false;
- m_gitClient->interactiveRebase(m_submitRepository, amendSHA1, true);
- } else {
- m_gitClient->continueCommandIfNeeded(m_submitRepository);
- }
- }
-
- if (m_gitClient->checkCommandInProgress(m_submitRepository) == GitClient::NoCommand) {
+ if (!closeEditor)
+ return false;
+ cleanCommitMessageFile();
+ if (commitType == FixupCommit) {
+ if (!m_gitClient->beginStashScope(m_submitRepository, QLatin1String("Rebase-fixup"), NoPrompt))
+ return false;
+ m_gitClient->interactiveRebase(m_submitRepository, amendSHA1, true);
+ } else {
+ m_gitClient->continueCommandIfNeeded(m_submitRepository);
if (editor->panelData().pushAction == NormalPush)
m_gitClient->push(m_submitRepository);
else if (editor->panelData().pushAction == PushToGerrit)
connect(editor, SIGNAL(destroyed()), this, SLOT(delayedPushToGerrit()));
}
- return closeEditor;
+ return true;
}
void GitPlugin::fetch()