github-repository-provider 7.25.51 → 7.25.54

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/README.md CHANGED
@@ -125,6 +125,8 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
125
125
 
126
126
  * `sha` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
127
127
 
128
+ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** sha
129
+
128
130
  ### tree
129
131
 
130
132
  * **See**: <https://developer.github.com/v3/git/trees/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-repository-provider",
3
- "version": "7.25.51",
3
+ "version": "7.25.54",
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",
34
- "fetch-link-util": "^1.0.6",
33
+ "content-entry": "^4.1.9",
34
+ "fetch-link-util": "^1.0.7",
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({
@@ -113,12 +113,26 @@ export class GithubBranch extends Branch {
113
113
  /**
114
114
  * {@link https://developer.github.com/v3/git/commits/#get-a-commit}
115
115
  * @param {string} sha
116
+ * @return {string} sha
116
117
  */
117
118
  async baseTreeSha(sha) {
119
+ if (this._baseTreeSha) {
120
+ const r = this._baseTreeSha.get(sha);
121
+ if (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
  /**