Method
isFileExists
(path: string, branch: string)
Source from the content-addressed store, hash-verified
| 756 | } |
| 757 | |
| 758 | async isFileExists(path: string, branch: string) { |
| 759 | const fileExists = await this.requestText({ |
| 760 | method: 'HEAD', |
| 761 | url: `${this.repoURL}/repository/files/${encodeURIComponent(path)}`, |
| 762 | params: { ref: branch }, |
| 763 | }) |
| 764 | .then(() => true) |
| 765 | .catch(error => { |
| 766 | if (error instanceof APIError && error.status === 404) { |
| 767 | return false; |
| 768 | } |
| 769 | throw error; |
| 770 | }); |
| 771 | |
| 772 | return fileExists; |
| 773 | } |
| 774 | |
| 775 | async getBranchMergeRequest(branch: string) { |
| 776 | const mergeRequests = await this.getMergeRequests(branch); |
Tested by
no test coverage detected