Git - move ensureStash inside StashGuard

this is where stash popup question belongs

Change-Id: Ib3435f12eacd0b932ba2a67ecd728e5a41c0c64a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Petar Perisin
2013-04-22 22:47:18 +02:00
parent 09ea0d235a
commit d425d6485e
4 changed files with 98 additions and 81 deletions

View File

@@ -1220,9 +1220,12 @@ void GitPlugin::stash()
// Simple stash without prompt, reset repo.
const VcsBase::VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return);
QString id;
gitClient()->ensureStash(state.topLevel(), QString(), NoPrompt, &id);
if (!id.isEmpty() && m_stashDialog)
GitClient::StashGuard stashGuard(state.topLevel(), QString(), NoPrompt);
if (stashGuard.stashingFailed())
return;
stashGuard.preventPop();
if (stashGuard.result() == GitClient::StashGuard::Stashed && m_stashDialog)
m_stashDialog->refresh(state.topLevel(), true);
}