Git: Fix crash on quit while rebase-todo editor is open

Change-Id: I458cbb2168642f226583b406e34596d223c7d5ea
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-07-31 21:12:41 +03:00
committed by Orgad Shaneh
parent 15a9019191
commit 3be6065b04
3 changed files with 36 additions and 25 deletions

View File

@@ -687,12 +687,16 @@ public:
~ConflictHandler()
{
GitClient *client = GitPlugin::instance()->gitClient();
if (m_commit.isEmpty() && m_files.isEmpty()) {
if (client->checkCommandInProgress(m_workingDirectory) == GitClient::NoCommand)
client->endStashScope(m_workingDirectory);
} else {
client->handleMergeConflicts(m_workingDirectory, m_commit, m_files, m_command);
// If interactive rebase editor window is closed, plugin is terminated
// but referenced here when the command ends
if (GitPlugin *plugin = GitPlugin::instance()) {
GitClient *client = plugin->gitClient();
if (m_commit.isEmpty() && m_files.isEmpty()) {
if (client->checkCommandInProgress(m_workingDirectory) == GitClient::NoCommand)
client->endStashScope(m_workingDirectory);
} else {
client->handleMergeConflicts(m_workingDirectory, m_commit, m_files, m_command);
}
}
}