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

Method backupBranch

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

Source from the content-addressed store, hash-verified

1277 }
1278
1279 async backupBranch(branchName: string) {
1280 try {
1281 const existingBranch = await this.getBranch(branchName);
1282 await this.createBranch(
1283 existingBranch.name.replace(
1284 new RegExp(`${CMS_BRANCH_PREFIX}/`),
1285 `${CMS_BRANCH_PREFIX}_${Date.now()}/`,
1286 ),
1287 existingBranch.commit.sha,
1288 );
1289 } catch (e) {
1290 console.warn(e);
1291 }
1292 }
1293
1294 async createBranch(branchName: string, sha: string) {
1295 try {

Callers 2

createBranchMethod · 0.95
mutateMethod · 0.80

Calls 3

getBranchMethod · 0.95
createBranchMethod · 0.95
replaceMethod · 0.80

Tested by

no test coverage detected