ogit
Version:
A lazy developer's Git CLI made simple. Makes using git on cloud IDEs (i.e. C9) a walk in the park.
26 lines (25 loc) • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const AbstractRevertCommand_1 = require("../abstracts/AbstractRevertCommand");
const git_1 = require("../wrapper/git");
class RevertLastCommitCommand extends AbstractRevertCommand_1.default {
run() {
const _super = name => super[name];
return tslib_1.__awaiter(this, void 0, void 0, function* () {
yield _super("runHelper").call(this);
});
}
getCommitHashes() {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
return [yield git_1.GitFacade.getLastCommitHash()];
});
}
preformRevertOnCommit(hash) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
yield git_1.GitFacade.deleteCommit(hash);
});
}
}
RevertLastCommitCommand.description = 'Deletes the last commit to repo, changes are removed from the file system';
exports.RevertLastCommitCommand = RevertLastCommitCommand;