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

Method backupBranch

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

Source from the content-addressed store, hash-verified

1290 }
1291
1292 async backupBranch(branchName: string) {
1293 try {
1294 const existingBranch = await this.getBranch(branchName);
1295 await this.createBranch(
1296 existingBranch.name.replace(
1297 new RegExp(`${CMS_BRANCH_PREFIX}/`),
1298 `${CMS_BRANCH_PREFIX}_${Date.now()}/`,
1299 ),
1300 existingBranch.commit.sha,
1301 );
1302 } catch (e) {
1303 console.warn(e);
1304 }
1305 }
1306
1307 async createBranch(branchName: string, sha: string) {
1308 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