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

Method getDifferences

packages/decap-cms-backend-github/src/API.ts:1064–1081  ·  view source on GitHub ↗
(from: string, to: string)

Source from the content-addressed store, hash-verified

1062 }
1063
1064 async getDifferences(from: string, to: string) {
1065 // retry this as sometimes GitHub returns an initial 404 on cross repo compare
1066 const attempts = this.useOpenAuthoring ? 10 : 1;
1067 for (let i = 1; i <= attempts; i++) {
1068 try {
1069 const result: Endpoints['GET /repos/{owner}/{repo}/compare/{base}...{head}']['response']['data'] =
1070 await this.request(`${this.originRepoURL}/compare/${from}...${to}`);
1071 return result;
1072 } catch (e) {
1073 if (i === attempts) {
1074 console.warn(`Reached maximum number of attempts '${attempts}' for getDifferences`);
1075 throw e;
1076 }
1077 await new Promise(resolve => setTimeout(resolve, i * 500));
1078 }
1079 }
1080 throw new APIError('Not Found', 404, API_NAME);
1081 }
1082
1083 async rebaseSingleCommit(baseCommit: GitHubCompareCommit, commit: GitHubCompareCommit) {
1084 // first get the diff between the commits

Callers 6

editorialWorkflowGitMethod · 0.95
rebaseSingleCommitMethod · 0.95
rebaseBranchMethod · 0.95
forceMergePRMethod · 0.95

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected