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

Method getDifferences

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

Source from the content-addressed store, hash-verified

1087 }
1088
1089 async getDifferences(from: string, to: string) {
1090 // retry this as sometimes GitHub returns an initial 404 on cross repo compare
1091 const attempts = this.useOpenAuthoring ? 10 : 1;
1092 for (let i = 1; i <= attempts; i++) {
1093 try {
1094 const result: Endpoints['GET /repos/{owner}/{repo}/compare/{base}...{head}']['response']['data'] =
1095 await this.request(`${this.originRepoURL}/compare/${from}...${to}`);
1096 return result;
1097 } catch (e) {
1098 if (i === attempts) {
1099 console.warn(`Reached maximum number of attempts '${attempts}' for getDifferences`);
1100 throw e;
1101 }
1102 await new Promise(resolve => setTimeout(resolve, i * 500));
1103 }
1104 }
1105 throw new APIError('Not Found', 404, API_NAME);
1106 }
1107
1108 async rebaseSingleCommit(baseCommit: GitHubCompareCommit, commit: GitHubCompareCommit) {
1109 // 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