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

Method backupBranch

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

Source from the content-addressed store, hash-verified

1251 }
1252
1253 async backupBranch(branchName: string) {
1254 try {
1255 const existingBranch = await this.getBranch(branchName);
1256 await this.createBranch(
1257 existingBranch.name.replace(
1258 new RegExp(`${CMS_BRANCH_PREFIX}/`),
1259 `${CMS_BRANCH_PREFIX}_${Date.now()}/`,
1260 ),
1261 existingBranch.commit.sha,
1262 );
1263 } catch (e) {
1264 console.warn(e);
1265 }
1266 }
1267
1268 async createBranch(branchName: string, sha: string) {
1269 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