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

Method isFileExists

packages/decap-cms-backend-gitlab/src/API.ts:758–773  ·  view source on GitHub ↗
(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);

Callers 1

getCommitItemsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected