Git: Explicitly pop stored stashes

If the user created another stashed between save and
pop, this stash will be restored instead of the intended
one.

Change-Id: I605c9f440345d8c7e0876f4f60daa7146bebb212
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-01-22 21:10:43 +02:00
parent 63439a5f21
commit c670a66fe1
3 changed files with 13 additions and 5 deletions

View File

@@ -261,8 +261,8 @@ void BranchDialog::merge()
if (gitClient->gitStatus(m_repository, StatusMode(NoUntracked | NoSubmodules)) == GitClient::StatusChanged)
gitClient->ensureStash(m_repository, QLatin1String("merge"), false, &stashMessage);
if (gitClient->synchronousMerge(m_repository, branch) && (!stashMessage.isEmpty()))
gitClient->stashPop(m_repository);
if (gitClient->synchronousMerge(m_repository, branch) && !stashMessage.isEmpty())
gitClient->stashPop(m_repository, stashMessage);
}
void BranchDialog::rebase()
@@ -278,8 +278,8 @@ void BranchDialog::rebase()
if (gitClient->gitStatus(m_repository, StatusMode(NoUntracked | NoSubmodules)) == GitClient::StatusChanged)
gitClient->ensureStash(m_repository, QLatin1String("rebase"), false, &stashMessage);
if (gitClient->synchronousRebase(m_repository, baseBranch) && (!stashMessage.isEmpty()))
gitClient->stashPop(m_repository);
if (gitClient->synchronousRebase(m_repository, baseBranch) && !stashMessage.isEmpty())
gitClient->stashPop(m_repository, stashMessage);
}
void BranchDialog::changeEvent(QEvent *e)