Git: Do not pull --rebase when changes are not stashed

Git will not do a pull --rebase when there are changes. So we
now abort if the user did not stash them instead of trying to
pull.

I do not want to revert user changes implicitly.

Task-number: QTCREATORBUG-7031
Change-Id: Ic6041755938be36d8ecdbcbac373b5c38642360d
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Tobias Hunger
2012-03-05 10:07:30 +01:00
parent d48136f312
commit 8973ef31cc
2 changed files with 7 additions and 2 deletions

View File

@@ -794,12 +794,17 @@ void GitPlugin::pull()
{
const VcsBase::VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return);
const bool rebase = m_gitClient->settings()->boolValue(GitSettings::pullRebaseKey);
switch (m_gitClient->ensureStash(state.topLevel())) {
case GitClient::StashUnchanged:
case GitClient::Stashed:
m_gitClient->synchronousPull(state.topLevel(), rebase);
break;
case GitClient::NotStashed:
m_gitClient->synchronousPull(state.topLevel());
if (!rebase)
m_gitClient->synchronousPull(state.topLevel(), false);
break;
default:
break;
}