aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git/gitplugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/git/gitplugin.cpp')
-rw-r--r--src/plugins/git/gitplugin.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index 391d27961f9..04f6b2e8d42 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -1069,7 +1069,6 @@ bool GitPlugin::submitEditorAboutToClose()
// Go ahead!
SubmitFileModel *model = qobject_cast<SubmitFileModel *>(editor->fileModel());
- bool closeEditor = true;
CommitType commitType = editor->commitType();
QString amendSHA1 = editor->amendSHA1();
if (model->hasCheckedFiles() || !amendSHA1.isEmpty()) {
@@ -1077,12 +1076,11 @@ bool GitPlugin::submitEditorAboutToClose()
if (!DocumentManager::saveDocument(editorDocument))
return false;
- closeEditor = m_gitClient->addAndCommit(m_submitRepository, editor->panelData(),
- commitType, amendSHA1,
- m_commitMessageFileName, model);
+ if (!m_gitClient->addAndCommit(m_submitRepository, editor->panelData(), commitType,
+ amendSHA1, m_commitMessageFileName, model)) {
+ return false;
+ }
}
- if (!closeEditor)
- return false;
cleanCommitMessageFile();
if (commitType == FixupCommit) {
if (!m_gitClient->beginStashScope(m_submitRepository, "Rebase-fixup",