Git: Disallow Commit and Push if rebase is in progress

Change-Id: I35a6cf850bccf076d22a73b98b0422663c61b1d3
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
This commit is contained in:
Orgad Shaneh
2013-10-02 15:14:26 +03:00
committed by Orgad Shaneh
parent c07eaa2a25
commit 1f0cbbc807
2 changed files with 19 additions and 13 deletions

View File

@@ -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()