github-repository-provider 7.25.57 → 7.25.58
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 +1 -1
- package/src/github-branch.mjs +15 -1
package/package.json
CHANGED
package/src/github-branch.mjs
CHANGED
|
@@ -140,10 +140,24 @@ export class GithubBranch extends Branch {
|
|
|
140
140
|
* @return {Object[]}
|
|
141
141
|
*/
|
|
142
142
|
async tree(sha) {
|
|
143
|
+
if (this._tree) {
|
|
144
|
+
const tree = this._tree.get(sha);
|
|
145
|
+
if (tree) {
|
|
146
|
+
return tree;
|
|
147
|
+
}
|
|
148
|
+
} else {
|
|
149
|
+
this._tree = new Map();
|
|
150
|
+
}
|
|
151
|
+
|
|
143
152
|
const { json } = await this.provider.fetchJSON(
|
|
144
153
|
`repos/${this.slug}/git/trees/${sha}?recursive=1`
|
|
145
154
|
);
|
|
146
|
-
|
|
155
|
+
|
|
156
|
+
const tree = json.tree;
|
|
157
|
+
|
|
158
|
+
this._tree.set(sha, tree);
|
|
159
|
+
|
|
160
|
+
return tree;
|
|
147
161
|
}
|
|
148
162
|
|
|
149
163
|
async *entries(patterns) {
|