sourcecontrol
Version:
A modern TypeScript CLI application for source control
22 lines • 781 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.BranchDelete = void 0;
class BranchDelete {
constructor(refService) {
this.refService = refService;
}
async deleteBranch(branchName, force = false) {
const currentBranch = await this.refService.getCurrentBranch();
if (currentBranch === branchName) {
throw new Error(`Cannot delete branch '${branchName}': currently checked out`);
}
if (!(await this.refService.exists(branchName))) {
throw new Error(`Branch '${branchName}' not found`);
}
if (!force) {
}
await this.refService.deleteBranch(branchName);
}
}
exports.BranchDelete = BranchDelete;
//# sourceMappingURL=branch-delete.js.map
;