github-repository-provider 7.25.52 → 7.25.53

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.25.52",
3
+ "version": "7.25.53",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -30,19 +30,19 @@
30
30
  "lint:docs": "documentation lint ./src/**/*.mjs"
31
31
  },
32
32
  "dependencies": {
33
- "content-entry": "^4.1.8",
33
+ "content-entry": "^4.1.9",
34
34
  "fetch-link-util": "^1.0.6",
35
35
  "fetch-rate-limit-util": "^2.4.10",
36
36
  "matching-iterator": "^2.0.3",
37
37
  "node-fetch": "^3.2.3",
38
38
  "one-time-execution-method": "^2.0.13",
39
- "repository-provider": "^27.0.3"
39
+ "repository-provider": "^27.0.4"
40
40
  },
41
41
  "devDependencies": {
42
42
  "ava": "^4.1.0",
43
43
  "c8": "^7.11.0",
44
44
  "documentation": "^13.2.5",
45
- "repository-provider-test-support": "^1.12.10",
45
+ "repository-provider-test-support": "^1.12.11",
46
46
  "semantic-release": "^19.0.2"
47
47
  },
48
48
  "engines": {
@@ -85,7 +85,7 @@ export class GithubBranch extends Branch {
85
85
  });
86
86
 
87
87
  r = await this.provider.fetchJSON(
88
- `repos/${this.slug}/git/refs/heads/${this.name}`,
88
+ `repos/${this.slug}/git/${this.ref}`,
89
89
  {
90
90
  method: "PATCH",
91
91
  body: JSON.stringify({
@@ -115,10 +115,24 @@ export class GithubBranch extends Branch {
115
115
  * @param {string} sha
116
116
  */
117
117
  async baseTreeSha(sha) {
118
+ if (this._baseTreeSha) {
119
+ const r = this._baseTreeSha.get(sha);
120
+ if (r) {
121
+ console.log("HIT", sha, r);
122
+ return r;
123
+ }
124
+ } else {
125
+ this._baseTreeSha = new Map();
126
+ }
127
+
118
128
  const { json } = await this.provider.fetchJSON(
119
129
  `repos/${this.slug}/git/commits/${sha}`
120
130
  );
121
- return json.tree.sha;
131
+
132
+ const r = json.tree.sha;
133
+ this._baseTreeSha.set(sha, r);
134
+
135
+ return r;
122
136
  }
123
137
 
124
138
  /**