mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 04:53:33 +01:00
@@ -1150,6 +1150,21 @@ export class UndoLastCommitAction extends GitAction {
|
||||
super(UndoLastCommitAction.ID, UndoLastCommitAction.LABEL, 'git-action undo-last-commit', gitService);
|
||||
}
|
||||
|
||||
protected isEnabled():boolean {
|
||||
if (!this.gitService) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.gitService.isIdle()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var status = this.gitService.getModel().getStatus();
|
||||
|
||||
return status.getIndexStatus().all().length === 0
|
||||
&& status.getWorkingTreeStatus().all().length === 0;
|
||||
}
|
||||
|
||||
public run():Promise {
|
||||
return this.gitService.reset('HEAD~');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user