| 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); |