github-repository-provider 7.24.7 → 7.24.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-repository-provider",
3
- "version": "7.24.7",
3
+ "version": "7.24.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -42,7 +42,7 @@
42
42
  "ava": "^3.15.0",
43
43
  "c8": "^7.11.0",
44
44
  "documentation": "^13.2.5",
45
- "repository-provider-test-support": "^1.8.15",
45
+ "repository-provider-test-support": "^1.9.0",
46
46
  "semantic-release": "^18.0.1"
47
47
  },
48
48
  "engines": {
@@ -135,27 +135,10 @@ export class GithubBranch extends Branch {
135
135
  * @return {Object[]}
136
136
  */
137
137
  async tree(treeSha) {
138
- const url = `repos/${this.slug}/git/trees/${treeSha}?recursive=1`;
139
-
140
- let res;
141
- for (let i = 0; i < 3; i++) {
142
- try {
143
- res = await this.provider.fetch(url);
144
- if (res.ok) {
145
- const json = await res.json();
146
- return json.tree;
147
- }
148
- } catch (e) {
149
- // errno: 'ERR_STREAM_PREMATURE_CLOSE',
150
- // code: 'ERR_STREAM_PREMATURE_CLOSE',
151
-
152
- this.error(e);
153
- }
154
- }
155
-
156
- console.log(res.errno, res.code);
157
-
158
- throw new Error(res.status);
138
+ const json = await this.provider.fetchJSON(
139
+ `repos/${this.slug}/git/trees/${treeSha}?recursive=1`
140
+ );
141
+ return json.tree;
159
142
  }
160
143
 
161
144
  async *entries(patterns) {