Merge pull request #71525 from jmbockhorst/confirmUndoMerge

Confirm "Undo last commit" if its a merge commit
This commit is contained in:
João Moreno
2019-10-17 07:01:23 -07:00
committed by GitHub

View File

@@ -1483,6 +1483,15 @@ export class CommandCenter {
const commit = await repository.getCommit('HEAD');
if (commit.parents.length > 1) {
const yes = localize('undo commit', "Undo merge commit");
const result = await window.showWarningMessage(localize('merge commit', "The last commit was a merge commit. Are you sure you want to undo it?"), yes);
if (result !== yes) {
return;
}
}
if (commit.parents.length > 0) {
await repository.reset('HEAD~');
} else {