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

Method patchRef

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

Source from the content-addressed store, hash-verified

430 }
431
432 async patchRef(type: string, name: string, sha: string, opts: { force?: boolean } = {}) {
433 if (type !== 'heads') {
434 return super.patchRef(type, name, sha, opts);
435 }
436
437 const force = opts.force || false;
438
439 const branch = await this.getBranch(name);
440 const { data } = await this.mutate({
441 mutation: mutations.updateBranch,
442 variables: {
443 input: { oid: sha, refId: branch.id, force },
444 },
445 });
446 return data!.updateRef.branch;
447 }
448
449 async deleteBranch(branchName: string) {
450 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