未验证 提交 fd8383a6 编写于 作者: J João Moreno 提交者: GitHub

Merge pull request #71525 from jmbockhorst/confirmUndoMerge

Confirm "Undo last commit" if its a merge commit
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册