Git: Use StashGuard inside RebaseManager

If the rebase succeeds without conflicts, pop

Change-Id: I4f0c6ad3061f4f69f7e5c9450f972cce5c15227d
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-05-01 07:30:51 +03:00
committed by Orgad Shaneh
parent fb40fd8297
commit 5d325f6b1a
3 changed files with 21 additions and 9 deletions

View File

@@ -78,6 +78,7 @@
#include <QAction>
#include <QFileDialog>
#include <QMessageBox>
#include <QScopedPointer>
static const unsigned minimumRequiredVersion = 0x010702;
@@ -758,17 +759,17 @@ void GitPlugin::startRebase()
QString workingDirectory = currentState().currentDirectoryOrTopLevel();
if (workingDirectory.isEmpty() || !m_gitClient->canRebase(workingDirectory))
return;
GitClient::StashGuard stashGuard(workingDirectory, QLatin1String("Rebase-i"));
if (stashGuard.stashingFailed())
QScopedPointer<GitClient::StashGuard> stashGuard(
new GitClient::StashGuard(workingDirectory, QLatin1String("Rebase-i")));
if (stashGuard->stashingFailed())
return;
stashGuard.preventPop();
LogChangeDialog dialog(false);
dialog.setWindowTitle(tr("Interactive Rebase"));
if (!dialog.runDialog(workingDirectory))
return;
const QString change = dialog.commit();
if (!change.isEmpty())
m_gitClient->interactiveRebase(workingDirectory, change + QLatin1Char('^'));
m_gitClient->interactiveRebase(workingDirectory, change, *stashGuard.take());
}
void GitPlugin::startChangeRelatedAction()