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

Method getDifferences

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

Source from the content-addressed store, hash-verified

1100 }
1101
1102 async getDifferences(from: string, to: string) {
1103 // retry this as sometimes GitHub returns an initial 404 on cross repo compare
1104 const attempts = this.useOpenAuthoring ? 10 : 1;
1105 for (let i = 1; i <= attempts; i++) {
1106 try {
1107 const result: Endpoints['GET /repos/{owner}/{repo}/compare/{base}...{head}']['response']['data'] =
1108 await this.request(`${this.originRepoURL}/compare/${from}...${to}`);
1109 return result;
1110 } catch (e) {
1111 if (i === attempts) {
1112 console.warn(`Reached maximum number of attempts '${attempts}' for getDifferences`);
1113 throw e;
1114 }
1115 await new Promise(resolve => setTimeout(resolve, i * 500));
1116 }
1117 }
1118 throw new APIError('Not Found', 404, API_NAME);
1119 }
1120
1121 async rebaseSingleCommit(baseCommit: GitHubCompareCommit, commit: GitHubCompareCommit) {
1122 // 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