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

Method isFileExists

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

Callers 1

getCommitItemsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected