MCPcopy Create free account
hub / github.com/decaporg/decap-cms / deleteBranch

Method deleteBranch

packages/decap-cms-backend-github/src/API.ts:1332–1343  ·  view source on GitHub ↗
(branchName: string)

Source from the content-addressed store, hash-verified

1330 }
1331
1332 deleteBranch(branchName: string) {
1333 return this.deleteRef('heads', branchName).catch((err: Error) => {
1334 // If the branch doesn't exist, then it has already been deleted -
1335 // deletion should be idempotent, so we can consider this a
1336 // success.
1337 if (err.message === 'Reference does not exist') {
1338 return Promise.resolve();
1339 }
1340 console.error(err);
1341 return Promise.reject(err);
1342 });
1343 }
1344
1345 async getHeadReference(head: string) {
1346 return `${this.repoOwner}:${head}`;

Callers 4

APIClass · 0.95
migrateToVersion1Method · 0.95

Calls 1

deleteRefMethod · 0.95

Tested by

no test coverage detected