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