forked from qt-creator/qt-creator
Git - couple fixes in branch based auto stash
- do not start stash scope when creating auto stash - return if reset fails Change-Id: I471abc1d430351192c46ac78041949ba81f11b09 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -192,15 +192,17 @@ void BranchDialog::checkout()
|
|||||||
m_model->checkoutBranch(idx);
|
m_model->checkoutBranch(idx);
|
||||||
} else if (branchCheckoutDialog.exec() == QDialog::Accepted && m_model) {
|
} else if (branchCheckoutDialog.exec() == QDialog::Accepted && m_model) {
|
||||||
|
|
||||||
QString stashMessage;
|
if (branchCheckoutDialog.makeStashOfCurrentBranch()) {
|
||||||
if (branchCheckoutDialog.makeStashOfCurrentBranch()
|
if (!gitClient->executeSynchronousStash(m_repository,
|
||||||
|| branchCheckoutDialog.moveLocalChangesToNextBranch()) {
|
currentBranch + QLatin1String("-AutoStash"))) {
|
||||||
|
return;
|
||||||
if (!gitClient->beginStashScope(m_repository, currentBranch + QLatin1String("-AutoStash"), NoPrompt))
|
}
|
||||||
|
} else if (branchCheckoutDialog.moveLocalChangesToNextBranch()) {
|
||||||
|
if (!gitClient->beginStashScope(m_repository, QLatin1String("Checkout"), NoPrompt))
|
||||||
return;
|
return;
|
||||||
stashMessage = gitClient->stashInfo(m_repository).stashMessage();
|
|
||||||
} else if (branchCheckoutDialog.discardLocalChanges()) {
|
} else if (branchCheckoutDialog.discardLocalChanges()) {
|
||||||
gitClient->synchronousReset(m_repository);
|
if (!gitClient->synchronousReset(m_repository))
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_model->checkoutBranch(idx);
|
m_model->checkoutBranch(idx);
|
||||||
@@ -214,7 +216,7 @@ void BranchDialog::checkout()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stashMessage.isEmpty() && branchCheckoutDialog.moveLocalChangesToNextBranch())
|
if (branchCheckoutDialog.moveLocalChangesToNextBranch())
|
||||||
gitClient->endStashScope(m_repository);
|
gitClient->endStashScope(m_repository);
|
||||||
else if (branchCheckoutDialog.popStashOfNextBranch())
|
else if (branchCheckoutDialog.popStashOfNextBranch())
|
||||||
gitClient->synchronousStashRestore(m_repository, stashName, true);
|
gitClient->synchronousStashRestore(m_repository, stashName, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user