Git: Fix popping of branch-stash after checkout

Checking out a branch that has a saved stash, when
Pop branch stash is checked, is broken since checkout
became asynchronous.

We must wait for checkout to complete before popping
the branch stash.

Change-Id: Ia4d43649e742ced0121ffe106986b4d6ed1e7b38
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Orgad Shaneh
2019-06-26 16:15:12 +03:00
committed by Orgad Shaneh
parent 0d7f33aa71
commit a1ba347fa5
5 changed files with 34 additions and 23 deletions

View File

@@ -602,15 +602,15 @@ void BranchModel::removeTag(const QModelIndex &idx)
removeNode(idx);
}
void BranchModel::checkoutBranch(const QModelIndex &idx)
VcsCommand *BranchModel::checkoutBranch(const QModelIndex &idx)
{
QString branch = fullName(idx, !isLocal(idx));
if (branch.isEmpty())
return;
return nullptr;
// No StashGuard since this function for now is only used with clean working dir.
// If it is ever used from another place, please add StashGuard here
d->client->checkout(d->workingDirectory, branch, GitClient::StashMode::NoStash);
return d->client->checkout(d->workingDirectory, branch, GitClient::StashMode::NoStash);
}
bool BranchModel::branchIsMerged(const QModelIndex &idx)