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

Method patchRef

packages/decap-cms-backend-github/src/GraphQLAPI.ts:438–453  ·  view source on GitHub ↗
(type: string, name: string, sha: string, opts: { force?: boolean } = {})

Source from the content-addressed store, hash-verified

436 }
437
438 async patchRef(type: string, name: string, sha: string, opts: { force?: boolean } = {}) {
439 if (type !== 'heads') {
440 return super.patchRef(type, name, sha, opts);
441 }
442
443 const force = opts.force || false;
444
445 const branch = await this.getBranch(name);
446 const { data } = await this.mutate({
447 mutation: mutations.updateBranch,
448 variables: {
449 input: { oid: sha, refId: branch.id, force },
450 },
451 });
452 return data!.updateRef.branch;
453 }
454
455 async deleteBranch(branchName: string) {
456 const branch = await this.getBranch(branchName);

Callers

nothing calls this directly

Calls 2

getBranchMethod · 0.95
mutateMethod · 0.95

Tested by

no test coverage detected