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