mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-30 05:21:08 +01:00
Merge pull request #71525 from jmbockhorst/confirmUndoMerge
Confirm "Undo last commit" if its a merge commit
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user