summaryrefslogtreecommitdiff
path: root/src/plugins/git/gitplugin.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2013-06-05 08:12:52 +0300
committerOrgad Shaneh <orgads@gmail.com>2013-06-05 13:24:16 +0200
commit63cf15b180980754b6ffea13bfd509ebfd06a69a (patch)
treebde02b3339ef15be6d9d4f8268fe5030ac7114a0 /src/plugins/git/gitplugin.cpp
parent2ee83d4c9e1166a81d1d7025674f9e201e3c8460 (diff)
downloadqt-creator-63cf15b180980754b6ffea13bfd509ebfd06a69a.tar.gz
Git: Start interactive rebase in topLevel
Change-Id: I99edfed36b12942e64ee1947a46eddd1ca08b9ba Reviewed-by: Petar Perisin <petar.perisin@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/git/gitplugin.cpp')
-rw-r--r--src/plugins/git/gitplugin.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index 1520e34ce2..38a88b1bc3 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -788,17 +788,19 @@ void GitPlugin::resetRepository()
void GitPlugin::startRebase()
{
- QString workingDirectory = currentState().currentDirectoryOrTopLevel();
- if (workingDirectory.isEmpty() || !m_gitClient->canRebase(workingDirectory))
+ const VcsBase::VcsBasePluginState state = currentState();
+ QTC_ASSERT(state.hasTopLevel(), return);
+ const QString topLevel = state.topLevel();
+ if (topLevel.isEmpty() || !m_gitClient->canRebase(topLevel))
return;
- if (!m_gitClient->beginStashScope(workingDirectory, QLatin1String("Rebase-i")))
+ if (!m_gitClient->beginStashScope(topLevel, QLatin1String("Rebase-i")))
return;
LogChangeDialog dialog(false);
dialog.setWindowTitle(tr("Interactive Rebase"));
- if (dialog.runDialog(workingDirectory, QString(), false))
- m_gitClient->interactiveRebase(workingDirectory, dialog.commit(), false);
+ if (dialog.runDialog(topLevel, QString(), false))
+ m_gitClient->interactiveRebase(topLevel, dialog.commit(), false);
else
- m_gitClient->endStashScope(workingDirectory);
+ m_gitClient->endStashScope(topLevel);
}
void GitPlugin::startChangeRelatedAction()