isomorphic-git 1.41.9 → 1.42.1
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/http/node/index.cjs +3 -1
- package/http/node/index.d.cts +3 -3
- package/http/node/index.d.ts +3 -3
- package/http/node/index.js +3 -1
- package/http/web/index.cjs +9 -2
- package/http/web/index.d.cts +3 -3
- package/http/web/index.d.ts +3 -3
- package/http/web/index.js +9 -2
- package/http/web/index.umd.js +9 -2
- package/index.cjs +56 -26
- package/index.d.cts +6 -15
- package/index.d.ts +6 -15
- package/index.js +56 -26
- package/index.umd.min.d.ts +6 -15
- package/index.umd.min.js +1 -1
- package/index.umd.min.js.map +1 -1
- package/managers/index.cjs +7 -1
- package/managers/index.d.cts +8 -4
- package/managers/index.d.ts +8 -4
- package/managers/index.js +7 -1
- package/managers/index.umd.min.js +1 -1
- package/managers/index.umd.min.js.map +1 -1
- package/package.json +1 -1
package/http/node/index.cjs
CHANGED
|
@@ -27,7 +27,7 @@ var get = _interopDefault(require('simple-get'));
|
|
|
27
27
|
* @property {Object} [agent] - An HTTP or HTTPS agent that manages connections for the HTTP client (Node.js only)
|
|
28
28
|
* @property {AsyncIterableIterator<Uint8Array>} [body] - An async iterator of Uint8Arrays that make up the body of POST requests
|
|
29
29
|
* @property {ProgressCallback} [onProgress] - Reserved for future use (emitting `GitProgressEvent`s)
|
|
30
|
-
* @property {
|
|
30
|
+
* @property {AbortSignal} [signal] - Signal to abort the HTTP request
|
|
31
31
|
* @property {Object} [fetchOptions={}] - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
32
32
|
*/
|
|
33
33
|
|
|
@@ -198,6 +198,7 @@ async function request({
|
|
|
198
198
|
agent,
|
|
199
199
|
fetchOptions = {},
|
|
200
200
|
body,
|
|
201
|
+
signal,
|
|
201
202
|
}) {
|
|
202
203
|
// If we can, we should send it as a single buffer so it sets a Content-Length header.
|
|
203
204
|
if (body && Array.isArray(body)) {
|
|
@@ -215,6 +216,7 @@ async function request({
|
|
|
215
216
|
headers,
|
|
216
217
|
agent,
|
|
217
218
|
body,
|
|
219
|
+
signal: signal ?? fetchOptions.signal,
|
|
218
220
|
},
|
|
219
221
|
(err, res) => {
|
|
220
222
|
if (err) return reject(err)
|
package/http/node/index.d.cts
CHANGED
|
@@ -34,9 +34,9 @@ export type GitHttpRequest = {
|
|
|
34
34
|
*/
|
|
35
35
|
onProgress?: ProgressCallback | undefined;
|
|
36
36
|
/**
|
|
37
|
-
* -
|
|
37
|
+
* - Signal to abort the HTTP request
|
|
38
38
|
*/
|
|
39
|
-
signal?:
|
|
39
|
+
signal?: AbortSignal | undefined;
|
|
40
40
|
/**
|
|
41
41
|
* - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
42
42
|
*/
|
|
@@ -83,4 +83,4 @@ declare namespace index {
|
|
|
83
83
|
* @param {GitHttpRequest} request
|
|
84
84
|
* @returns {Promise<GitHttpResponse>}
|
|
85
85
|
*/
|
|
86
|
-
export function request({ onProgress, url, method, headers, agent, fetchOptions, body, }: GitHttpRequest): Promise<GitHttpResponse>;
|
|
86
|
+
export function request({ onProgress, url, method, headers, agent, fetchOptions, body, signal, }: GitHttpRequest): Promise<GitHttpResponse>;
|
package/http/node/index.d.ts
CHANGED
|
@@ -33,9 +33,9 @@ export type GitHttpRequest = {
|
|
|
33
33
|
*/
|
|
34
34
|
onProgress?: ProgressCallback | undefined;
|
|
35
35
|
/**
|
|
36
|
-
* -
|
|
36
|
+
* - Signal to abort the HTTP request
|
|
37
37
|
*/
|
|
38
|
-
signal?:
|
|
38
|
+
signal?: AbortSignal | undefined;
|
|
39
39
|
/**
|
|
40
40
|
* - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
41
41
|
*/
|
|
@@ -82,4 +82,4 @@ declare namespace index {
|
|
|
82
82
|
* @param {GitHttpRequest} request
|
|
83
83
|
* @returns {Promise<GitHttpResponse>}
|
|
84
84
|
*/
|
|
85
|
-
export function request({ onProgress, url, method, headers, agent, fetchOptions, body, }: GitHttpRequest): Promise<GitHttpResponse>;
|
|
85
|
+
export function request({ onProgress, url, method, headers, agent, fetchOptions, body, signal, }: GitHttpRequest): Promise<GitHttpResponse>;
|
package/http/node/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import get from 'simple-get';
|
|
|
21
21
|
* @property {Object} [agent] - An HTTP or HTTPS agent that manages connections for the HTTP client (Node.js only)
|
|
22
22
|
* @property {AsyncIterableIterator<Uint8Array>} [body] - An async iterator of Uint8Arrays that make up the body of POST requests
|
|
23
23
|
* @property {ProgressCallback} [onProgress] - Reserved for future use (emitting `GitProgressEvent`s)
|
|
24
|
-
* @property {
|
|
24
|
+
* @property {AbortSignal} [signal] - Signal to abort the HTTP request
|
|
25
25
|
* @property {Object} [fetchOptions={}] - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
26
26
|
*/
|
|
27
27
|
|
|
@@ -192,6 +192,7 @@ async function request({
|
|
|
192
192
|
agent,
|
|
193
193
|
fetchOptions = {},
|
|
194
194
|
body,
|
|
195
|
+
signal,
|
|
195
196
|
}) {
|
|
196
197
|
// If we can, we should send it as a single buffer so it sets a Content-Length header.
|
|
197
198
|
if (body && Array.isArray(body)) {
|
|
@@ -209,6 +210,7 @@ async function request({
|
|
|
209
210
|
headers,
|
|
210
211
|
agent,
|
|
211
212
|
body,
|
|
213
|
+
signal: signal ?? fetchOptions.signal,
|
|
212
214
|
},
|
|
213
215
|
(err, res) => {
|
|
214
216
|
if (err) return reject(err)
|
package/http/web/index.cjs
CHANGED
|
@@ -23,7 +23,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
23
23
|
* @property {Object} [agent] - An HTTP or HTTPS agent that manages connections for the HTTP client (Node.js only)
|
|
24
24
|
* @property {AsyncIterableIterator<Uint8Array>} [body] - An async iterator of Uint8Arrays that make up the body of POST requests
|
|
25
25
|
* @property {ProgressCallback} [onProgress] - Reserved for future use (emitting `GitProgressEvent`s)
|
|
26
|
-
* @property {
|
|
26
|
+
* @property {AbortSignal} [signal] - Signal to abort the HTTP request
|
|
27
27
|
* @property {Object} [fetchOptions={}] - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
28
28
|
*/
|
|
29
29
|
|
|
@@ -142,13 +142,20 @@ async function request({
|
|
|
142
142
|
headers = {},
|
|
143
143
|
fetchOptions = {},
|
|
144
144
|
body,
|
|
145
|
+
signal,
|
|
145
146
|
}) {
|
|
146
147
|
// streaming uploads aren't possible yet in the browser
|
|
147
148
|
if (body) {
|
|
148
149
|
// @ts-expect-error
|
|
149
150
|
body = await collect(body);
|
|
150
151
|
}
|
|
151
|
-
const res = await fetch(url, {
|
|
152
|
+
const res = await fetch(url, {
|
|
153
|
+
...fetchOptions,
|
|
154
|
+
method,
|
|
155
|
+
headers,
|
|
156
|
+
body,
|
|
157
|
+
signal: signal ?? fetchOptions.signal,
|
|
158
|
+
});
|
|
152
159
|
const iter =
|
|
153
160
|
// @ts-expect-error
|
|
154
161
|
res.body && res.body.getReader
|
package/http/web/index.d.cts
CHANGED
|
@@ -34,9 +34,9 @@ export type GitHttpRequest = {
|
|
|
34
34
|
*/
|
|
35
35
|
onProgress?: ProgressCallback | undefined;
|
|
36
36
|
/**
|
|
37
|
-
* -
|
|
37
|
+
* - Signal to abort the HTTP request
|
|
38
38
|
*/
|
|
39
|
-
signal?:
|
|
39
|
+
signal?: AbortSignal | undefined;
|
|
40
40
|
/**
|
|
41
41
|
* - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
42
42
|
*/
|
|
@@ -83,4 +83,4 @@ declare namespace index {
|
|
|
83
83
|
* @param {GitHttpRequest} request
|
|
84
84
|
* @returns {Promise<GitHttpResponse>}
|
|
85
85
|
*/
|
|
86
|
-
export function request({ onProgress, url, method, headers, fetchOptions, body, }: GitHttpRequest): Promise<GitHttpResponse>;
|
|
86
|
+
export function request({ onProgress, url, method, headers, fetchOptions, body, signal, }: GitHttpRequest): Promise<GitHttpResponse>;
|
package/http/web/index.d.ts
CHANGED
|
@@ -33,9 +33,9 @@ export type GitHttpRequest = {
|
|
|
33
33
|
*/
|
|
34
34
|
onProgress?: ProgressCallback | undefined;
|
|
35
35
|
/**
|
|
36
|
-
* -
|
|
36
|
+
* - Signal to abort the HTTP request
|
|
37
37
|
*/
|
|
38
|
-
signal?:
|
|
38
|
+
signal?: AbortSignal | undefined;
|
|
39
39
|
/**
|
|
40
40
|
* - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
41
41
|
*/
|
|
@@ -82,4 +82,4 @@ declare namespace index {
|
|
|
82
82
|
* @param {GitHttpRequest} request
|
|
83
83
|
* @returns {Promise<GitHttpResponse>}
|
|
84
84
|
*/
|
|
85
|
-
export function request({ onProgress, url, method, headers, fetchOptions, body, }: GitHttpRequest): Promise<GitHttpResponse>;
|
|
85
|
+
export function request({ onProgress, url, method, headers, fetchOptions, body, signal, }: GitHttpRequest): Promise<GitHttpResponse>;
|
package/http/web/index.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* @property {Object} [agent] - An HTTP or HTTPS agent that manages connections for the HTTP client (Node.js only)
|
|
20
20
|
* @property {AsyncIterableIterator<Uint8Array>} [body] - An async iterator of Uint8Arrays that make up the body of POST requests
|
|
21
21
|
* @property {ProgressCallback} [onProgress] - Reserved for future use (emitting `GitProgressEvent`s)
|
|
22
|
-
* @property {
|
|
22
|
+
* @property {AbortSignal} [signal] - Signal to abort the HTTP request
|
|
23
23
|
* @property {Object} [fetchOptions={}] - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
24
24
|
*/
|
|
25
25
|
|
|
@@ -138,13 +138,20 @@ async function request({
|
|
|
138
138
|
headers = {},
|
|
139
139
|
fetchOptions = {},
|
|
140
140
|
body,
|
|
141
|
+
signal,
|
|
141
142
|
}) {
|
|
142
143
|
// streaming uploads aren't possible yet in the browser
|
|
143
144
|
if (body) {
|
|
144
145
|
// @ts-expect-error
|
|
145
146
|
body = await collect(body);
|
|
146
147
|
}
|
|
147
|
-
const res = await fetch(url, {
|
|
148
|
+
const res = await fetch(url, {
|
|
149
|
+
...fetchOptions,
|
|
150
|
+
method,
|
|
151
|
+
headers,
|
|
152
|
+
body,
|
|
153
|
+
signal: signal ?? fetchOptions.signal,
|
|
154
|
+
});
|
|
148
155
|
const iter =
|
|
149
156
|
// @ts-expect-error
|
|
150
157
|
res.body && res.body.getReader
|
package/http/web/index.umd.js
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* @property {Object} [agent] - An HTTP or HTTPS agent that manages connections for the HTTP client (Node.js only)
|
|
26
26
|
* @property {AsyncIterableIterator<Uint8Array>} [body] - An async iterator of Uint8Arrays that make up the body of POST requests
|
|
27
27
|
* @property {ProgressCallback} [onProgress] - Reserved for future use (emitting `GitProgressEvent`s)
|
|
28
|
-
* @property {
|
|
28
|
+
* @property {AbortSignal} [signal] - Signal to abort the HTTP request
|
|
29
29
|
* @property {Object} [fetchOptions={}] - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
30
30
|
*/
|
|
31
31
|
|
|
@@ -144,13 +144,20 @@
|
|
|
144
144
|
headers = {},
|
|
145
145
|
fetchOptions = {},
|
|
146
146
|
body,
|
|
147
|
+
signal,
|
|
147
148
|
}) {
|
|
148
149
|
// streaming uploads aren't possible yet in the browser
|
|
149
150
|
if (body) {
|
|
150
151
|
// @ts-expect-error
|
|
151
152
|
body = await collect(body);
|
|
152
153
|
}
|
|
153
|
-
const res = await fetch(url, {
|
|
154
|
+
const res = await fetch(url, {
|
|
155
|
+
...fetchOptions,
|
|
156
|
+
method,
|
|
157
|
+
headers,
|
|
158
|
+
body,
|
|
159
|
+
signal: signal ?? fetchOptions.signal,
|
|
160
|
+
});
|
|
154
161
|
const iter =
|
|
155
162
|
// @ts-expect-error
|
|
156
163
|
res.body && res.body.getReader
|
package/index.cjs
CHANGED
|
@@ -35,7 +35,7 @@ var diff3Merge = _interopDefault(require('diff3'));
|
|
|
35
35
|
* @property {Object} [agent] - An HTTP or HTTPS agent that manages connections for the HTTP client (Node.js only)
|
|
36
36
|
* @property {AsyncIterableIterator<Uint8Array>} [body] - An async iterator of Uint8Arrays that make up the body of POST requests
|
|
37
37
|
* @property {ProgressCallback} [onProgress] - Reserved for future use (emitting `GitProgressEvent`s)
|
|
38
|
-
* @property {
|
|
38
|
+
* @property {AbortSignal} [signal] - Signal to abort the HTTP request
|
|
39
39
|
* @property {Object} [fetchOptions={}] - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
40
40
|
*/
|
|
41
41
|
|
|
@@ -9397,6 +9397,7 @@ class GitRemoteHTTP {
|
|
|
9397
9397
|
* @param {string} args.service - The Git service (e.g., "git-upload-pack").
|
|
9398
9398
|
* @param {string} args.url - The URL of the remote repository.
|
|
9399
9399
|
* @param {Object<string, string>} args.headers - HTTP headers to include in the request.
|
|
9400
|
+
* @param {AbortSignal} [args.signal] - Signal to abort the operation.
|
|
9400
9401
|
* @param {1 | 2} args.protocolVersion - The Git protocol version to use.
|
|
9401
9402
|
* @returns {Promise<Object>} - The parsed response from the remote repository.
|
|
9402
9403
|
* @throws {HttpError} - If the HTTP request fails.
|
|
@@ -9413,6 +9414,7 @@ class GitRemoteHTTP {
|
|
|
9413
9414
|
service,
|
|
9414
9415
|
url: _origUrl,
|
|
9415
9416
|
headers,
|
|
9417
|
+
signal,
|
|
9416
9418
|
protocolVersion,
|
|
9417
9419
|
}) {
|
|
9418
9420
|
let { url, auth } = extractAuthFromUrl(_origUrl);
|
|
@@ -9433,6 +9435,7 @@ class GitRemoteHTTP {
|
|
|
9433
9435
|
method: 'GET',
|
|
9434
9436
|
url: `${proxifiedURL}/info/refs?service=${service}`,
|
|
9435
9437
|
headers,
|
|
9438
|
+
signal,
|
|
9436
9439
|
});
|
|
9437
9440
|
|
|
9438
9441
|
// the default loop behavior
|
|
@@ -9508,6 +9511,7 @@ class GitRemoteHTTP {
|
|
|
9508
9511
|
* @param {Object<string, string>} [args.headers] - HTTP headers to include in the request.
|
|
9509
9512
|
* @param {any} args.body - The request body to send.
|
|
9510
9513
|
* @param {any} args.auth - Authentication credentials.
|
|
9514
|
+
* @param {AbortSignal} [args.signal] - Signal to abort the operation.
|
|
9511
9515
|
* @returns {Promise<GitHttpResponse>} - The HTTP response from the remote repository.
|
|
9512
9516
|
* @throws {HttpError} - If the HTTP request fails.
|
|
9513
9517
|
*/
|
|
@@ -9520,6 +9524,7 @@ class GitRemoteHTTP {
|
|
|
9520
9524
|
auth,
|
|
9521
9525
|
body,
|
|
9522
9526
|
headers,
|
|
9527
|
+
signal,
|
|
9523
9528
|
}) {
|
|
9524
9529
|
// We already have the "correct" auth value at this point, but
|
|
9525
9530
|
// we need to strip out the username/password from the URL yet again.
|
|
@@ -9538,6 +9543,7 @@ class GitRemoteHTTP {
|
|
|
9538
9543
|
url: `${url}/${service}`,
|
|
9539
9544
|
body,
|
|
9540
9545
|
headers,
|
|
9546
|
+
signal,
|
|
9541
9547
|
});
|
|
9542
9548
|
if (res.statusCode !== 200) {
|
|
9543
9549
|
const { response } = stringifyBody(res);
|
|
@@ -9773,8 +9779,8 @@ function filterCapabilities(server, client) {
|
|
|
9773
9779
|
|
|
9774
9780
|
const pkg = {
|
|
9775
9781
|
name: 'isomorphic-git',
|
|
9776
|
-
version: '1.
|
|
9777
|
-
agent: 'git/isomorphic-git@1.
|
|
9782
|
+
version: '1.42.1',
|
|
9783
|
+
agent: 'git/isomorphic-git@1.42.1',
|
|
9778
9784
|
};
|
|
9779
9785
|
|
|
9780
9786
|
class FIFO {
|
|
@@ -12083,6 +12089,30 @@ async function getConfigAll({
|
|
|
12083
12089
|
*
|
|
12084
12090
|
*/
|
|
12085
12091
|
|
|
12092
|
+
// Assign `value` at the `/`-separated `path` inside `root`, creating the
|
|
12093
|
+
// intermediate objects as we go.
|
|
12094
|
+
//
|
|
12095
|
+
// Ref names come straight off the wire, so a path segment must never be allowed
|
|
12096
|
+
// to walk out of `root` and into the prototype chain. The `hasOwnProperty` check
|
|
12097
|
+
// takes care of inherited keys such as `constructor` by shadowing them with a
|
|
12098
|
+
// fresh object; `__proto__` gets no such treatment because assigning it invokes
|
|
12099
|
+
// the setter instead of creating an own property, so refs containing it are
|
|
12100
|
+
// dropped.
|
|
12101
|
+
//
|
|
12102
|
+
// NB: deliberately not a JSDoc comment. `__tests__/__helpers__/generate-docs.cjs`
|
|
12103
|
+
// turns every documented function in `src/api` into a public doc page.
|
|
12104
|
+
function assignRefPath(root, path, value) {
|
|
12105
|
+
const parts = path.split('/');
|
|
12106
|
+
const last = parts.pop();
|
|
12107
|
+
if (last === '__proto__' || parts.includes('__proto__')) return
|
|
12108
|
+
let o = root;
|
|
12109
|
+
for (const part of parts) {
|
|
12110
|
+
if (!Object.prototype.hasOwnProperty.call(o, part)) o[part] = {};
|
|
12111
|
+
o = o[part];
|
|
12112
|
+
}
|
|
12113
|
+
o[last] = value;
|
|
12114
|
+
}
|
|
12115
|
+
|
|
12086
12116
|
/**
|
|
12087
12117
|
* List a remote servers branches, tags, and capabilities.
|
|
12088
12118
|
*
|
|
@@ -12147,25 +12177,11 @@ async function getRemoteInfo({
|
|
|
12147
12177
|
// Convert the flat list into an object tree, because I figure 99% of the time
|
|
12148
12178
|
// that will be easier to use.
|
|
12149
12179
|
for (const [ref, oid] of remote.refs) {
|
|
12150
|
-
|
|
12151
|
-
const last = parts.pop();
|
|
12152
|
-
let o = result;
|
|
12153
|
-
for (const part of parts) {
|
|
12154
|
-
o[part] = o[part] || {};
|
|
12155
|
-
o = o[part];
|
|
12156
|
-
}
|
|
12157
|
-
o[last] = oid;
|
|
12180
|
+
assignRefPath(result, ref, oid);
|
|
12158
12181
|
}
|
|
12159
12182
|
// Merge symrefs on top of refs to more closely match actual git repo layouts
|
|
12160
12183
|
for (const [symref, ref] of remote.symrefs) {
|
|
12161
|
-
|
|
12162
|
-
const last = parts.pop();
|
|
12163
|
-
let o = result;
|
|
12164
|
-
for (const part of parts) {
|
|
12165
|
-
o[part] = o[part] || {};
|
|
12166
|
-
o = o[part];
|
|
12167
|
-
}
|
|
12168
|
-
o[last] = ref;
|
|
12184
|
+
assignRefPath(result, symref, ref);
|
|
12169
12185
|
}
|
|
12170
12186
|
return result
|
|
12171
12187
|
} catch (err) {
|
|
@@ -14339,6 +14355,7 @@ async function writeReceivePackRequest({
|
|
|
14339
14355
|
* @param {boolean} [args.delete = false]
|
|
14340
14356
|
* @param {string} [args.url]
|
|
14341
14357
|
* @param {string} [args.corsProxy]
|
|
14358
|
+
* @param {AbortSignal} [args.signal]
|
|
14342
14359
|
* @param {Object<string, string>} [args.headers]
|
|
14343
14360
|
*
|
|
14344
14361
|
* @returns {Promise<PushResult>}
|
|
@@ -14362,6 +14379,7 @@ async function _push({
|
|
|
14362
14379
|
delete: _delete = false,
|
|
14363
14380
|
corsProxy,
|
|
14364
14381
|
headers = {},
|
|
14382
|
+
signal,
|
|
14365
14383
|
}) {
|
|
14366
14384
|
const ref = _ref || (await _currentBranch({ fs, gitdir }));
|
|
14367
14385
|
if (typeof ref === 'undefined') {
|
|
@@ -14410,6 +14428,7 @@ async function _push({
|
|
|
14410
14428
|
url,
|
|
14411
14429
|
headers,
|
|
14412
14430
|
protocolVersion: 1,
|
|
14431
|
+
signal,
|
|
14413
14432
|
});
|
|
14414
14433
|
const auth = httpRemote.auth; // hack to get new credentials from CredentialManager API
|
|
14415
14434
|
let fullRemoteRef;
|
|
@@ -14457,13 +14476,20 @@ async function _push({
|
|
|
14457
14476
|
|
|
14458
14477
|
// If remote branch is present, look for a common merge base.
|
|
14459
14478
|
if (oldoid !== '0000000000000000000000000000000000000000') {
|
|
14460
|
-
//
|
|
14461
|
-
|
|
14462
|
-
|
|
14463
|
-
|
|
14464
|
-
|
|
14465
|
-
|
|
14466
|
-
|
|
14479
|
+
// Speeds up common force-push / thin-pack scenarios. The advertised
|
|
14480
|
+
// remote tip may be absent locally (e.g. remote advanced since clone);
|
|
14481
|
+
// that is normal and must not surface as NotFoundError from merge-base.
|
|
14482
|
+
let mergebase = [];
|
|
14483
|
+
try {
|
|
14484
|
+
mergebase = await _findMergeBase({
|
|
14485
|
+
fs,
|
|
14486
|
+
cache,
|
|
14487
|
+
gitdir,
|
|
14488
|
+
oids: [oid, oldoid],
|
|
14489
|
+
});
|
|
14490
|
+
} catch (e) {
|
|
14491
|
+
mergebase = [];
|
|
14492
|
+
}
|
|
14467
14493
|
for (const oid of mergebase) finish.push(oid);
|
|
14468
14494
|
if (thinPack) {
|
|
14469
14495
|
skipObjects = await listObjects({ fs, cache, gitdir, oids: mergebase });
|
|
@@ -14565,6 +14591,7 @@ async function _push({
|
|
|
14565
14591
|
auth,
|
|
14566
14592
|
headers,
|
|
14567
14593
|
body: [...packstream1, ...packstream2],
|
|
14594
|
+
signal,
|
|
14568
14595
|
});
|
|
14569
14596
|
const { packfile, progress } = await GitSideBand.demux(res.body);
|
|
14570
14597
|
if (onMessage) {
|
|
@@ -14641,6 +14668,7 @@ async function _push({
|
|
|
14641
14668
|
* @param {string} [args.corsProxy] - Optional [CORS proxy](https://www.npmjs.com/%40isomorphic-git/cors-proxy). Overrides value in repo config.
|
|
14642
14669
|
* @param {Object<string, string>} [args.headers] - Additional headers to include in HTTP requests, similar to git's `extraHeader` config
|
|
14643
14670
|
* @param {object} [args.cache] - a [cache](cache.md) object
|
|
14671
|
+
* @param {AbortSignal} [args.signal] - Optional signal to abort the push operation
|
|
14644
14672
|
*
|
|
14645
14673
|
* @returns {Promise<PushResult>} Resolves successfully when push completes with a detailed description of the operation from the server.
|
|
14646
14674
|
* @see PushResult
|
|
@@ -14678,6 +14706,7 @@ async function push({
|
|
|
14678
14706
|
corsProxy,
|
|
14679
14707
|
headers = {},
|
|
14680
14708
|
cache = {},
|
|
14709
|
+
signal,
|
|
14681
14710
|
}) {
|
|
14682
14711
|
try {
|
|
14683
14712
|
assertParameter('fs', fs);
|
|
@@ -14705,6 +14734,7 @@ async function push({
|
|
|
14705
14734
|
delete: _delete,
|
|
14706
14735
|
corsProxy,
|
|
14707
14736
|
headers,
|
|
14737
|
+
signal,
|
|
14708
14738
|
})
|
|
14709
14739
|
} catch (err) {
|
|
14710
14740
|
err.caller = 'git.push';
|
package/index.d.cts
CHANGED
|
@@ -302,9 +302,9 @@ export type GitHttpRequest = {
|
|
|
302
302
|
*/
|
|
303
303
|
onProgress?: ProgressCallback | undefined;
|
|
304
304
|
/**
|
|
305
|
-
* -
|
|
305
|
+
* - Signal to abort the HTTP request
|
|
306
306
|
*/
|
|
307
|
-
signal?:
|
|
307
|
+
signal?: AbortSignal | undefined;
|
|
308
308
|
/**
|
|
309
309
|
* - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
310
310
|
*/
|
|
@@ -1660,17 +1660,6 @@ export function getConfigAll({ fs, dir, gitdir, path, }: {
|
|
|
1660
1660
|
gitdir?: string | undefined;
|
|
1661
1661
|
path: string;
|
|
1662
1662
|
}): Promise<Array<any>>;
|
|
1663
|
-
/**
|
|
1664
|
-
*
|
|
1665
|
-
* @typedef {Object} GetRemoteInfoResult - The object returned has the following schema:
|
|
1666
|
-
* @property {string[]} capabilities - The list of capabilities returned by the server (part of the Git protocol)
|
|
1667
|
-
* @property {Object} [refs]
|
|
1668
|
-
* @property {string} [HEAD] - The default branch of the remote
|
|
1669
|
-
* @property {Object<string, string>} [refs.heads] - The branches on the remote
|
|
1670
|
-
* @property {Object<string, string>} [refs.pull] - The special branches representing pull requests (non-standard)
|
|
1671
|
-
* @property {Object<string, string>} [refs.tags] - The tags on the remote
|
|
1672
|
-
*
|
|
1673
|
-
*/
|
|
1674
1663
|
/**
|
|
1675
1664
|
* List a remote servers branches, tags, and capabilities.
|
|
1676
1665
|
*
|
|
@@ -2517,6 +2506,7 @@ export function pull({ fs: _fs, http, onProgress, onMessage, onAuth, onAuthSucce
|
|
|
2517
2506
|
* @param {string} [args.corsProxy] - Optional [CORS proxy](https://www.npmjs.com/%40isomorphic-git/cors-proxy). Overrides value in repo config.
|
|
2518
2507
|
* @param {Object<string, string>} [args.headers] - Additional headers to include in HTTP requests, similar to git's `extraHeader` config
|
|
2519
2508
|
* @param {object} [args.cache] - a [cache](cache.md) object
|
|
2509
|
+
* @param {AbortSignal} [args.signal] - Optional signal to abort the push operation
|
|
2520
2510
|
*
|
|
2521
2511
|
* @returns {Promise<PushResult>} Resolves successfully when push completes with a detailed description of the operation from the server.
|
|
2522
2512
|
* @see PushResult
|
|
@@ -2534,7 +2524,7 @@ export function pull({ fs: _fs, http, onProgress, onMessage, onAuth, onAuthSucce
|
|
|
2534
2524
|
* console.log(pushResult)
|
|
2535
2525
|
*
|
|
2536
2526
|
*/
|
|
2537
|
-
export function push({ fs, http, onProgress, onMessage, onAuth, onAuthSuccess, onAuthFailure, onPrePush, dir, gitdir, ref, remoteRef, remote, url, force, delete: _delete, corsProxy, headers, cache, }: {
|
|
2527
|
+
export function push({ fs, http, onProgress, onMessage, onAuth, onAuthSuccess, onAuthFailure, onPrePush, dir, gitdir, ref, remoteRef, remote, url, force, delete: _delete, corsProxy, headers, cache, signal, }: {
|
|
2538
2528
|
fs: FsClient;
|
|
2539
2529
|
http: HttpClient;
|
|
2540
2530
|
onProgress?: ProgressCallback | undefined;
|
|
@@ -2556,6 +2546,7 @@ export function push({ fs, http, onProgress, onMessage, onAuth, onAuthSuccess, o
|
|
|
2556
2546
|
[x: string]: string;
|
|
2557
2547
|
} | undefined;
|
|
2558
2548
|
cache?: object;
|
|
2549
|
+
signal?: AbortSignal | undefined;
|
|
2559
2550
|
}): Promise<PushResult>;
|
|
2560
2551
|
/**
|
|
2561
2552
|
*
|
|
@@ -4504,7 +4495,7 @@ declare namespace NoCommitError {
|
|
|
4504
4495
|
* @property {Object} [agent] - An HTTP or HTTPS agent that manages connections for the HTTP client (Node.js only)
|
|
4505
4496
|
* @property {AsyncIterableIterator<Uint8Array>} [body] - An async iterator of Uint8Arrays that make up the body of POST requests
|
|
4506
4497
|
* @property {ProgressCallback} [onProgress] - Reserved for future use (emitting `GitProgressEvent`s)
|
|
4507
|
-
* @property {
|
|
4498
|
+
* @property {AbortSignal} [signal] - Signal to abort the HTTP request
|
|
4508
4499
|
* @property {Object} [fetchOptions={}] - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
4509
4500
|
*/
|
|
4510
4501
|
/**
|
package/index.d.ts
CHANGED
|
@@ -301,9 +301,9 @@ export type GitHttpRequest = {
|
|
|
301
301
|
*/
|
|
302
302
|
onProgress?: ProgressCallback | undefined;
|
|
303
303
|
/**
|
|
304
|
-
* -
|
|
304
|
+
* - Signal to abort the HTTP request
|
|
305
305
|
*/
|
|
306
|
-
signal?:
|
|
306
|
+
signal?: AbortSignal | undefined;
|
|
307
307
|
/**
|
|
308
308
|
* - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
309
309
|
*/
|
|
@@ -1659,17 +1659,6 @@ export function getConfigAll({ fs, dir, gitdir, path, }: {
|
|
|
1659
1659
|
gitdir?: string | undefined;
|
|
1660
1660
|
path: string;
|
|
1661
1661
|
}): Promise<Array<any>>;
|
|
1662
|
-
/**
|
|
1663
|
-
*
|
|
1664
|
-
* @typedef {Object} GetRemoteInfoResult - The object returned has the following schema:
|
|
1665
|
-
* @property {string[]} capabilities - The list of capabilities returned by the server (part of the Git protocol)
|
|
1666
|
-
* @property {Object} [refs]
|
|
1667
|
-
* @property {string} [HEAD] - The default branch of the remote
|
|
1668
|
-
* @property {Object<string, string>} [refs.heads] - The branches on the remote
|
|
1669
|
-
* @property {Object<string, string>} [refs.pull] - The special branches representing pull requests (non-standard)
|
|
1670
|
-
* @property {Object<string, string>} [refs.tags] - The tags on the remote
|
|
1671
|
-
*
|
|
1672
|
-
*/
|
|
1673
1662
|
/**
|
|
1674
1663
|
* List a remote servers branches, tags, and capabilities.
|
|
1675
1664
|
*
|
|
@@ -2516,6 +2505,7 @@ export function pull({ fs: _fs, http, onProgress, onMessage, onAuth, onAuthSucce
|
|
|
2516
2505
|
* @param {string} [args.corsProxy] - Optional [CORS proxy](https://www.npmjs.com/%40isomorphic-git/cors-proxy). Overrides value in repo config.
|
|
2517
2506
|
* @param {Object<string, string>} [args.headers] - Additional headers to include in HTTP requests, similar to git's `extraHeader` config
|
|
2518
2507
|
* @param {object} [args.cache] - a [cache](cache.md) object
|
|
2508
|
+
* @param {AbortSignal} [args.signal] - Optional signal to abort the push operation
|
|
2519
2509
|
*
|
|
2520
2510
|
* @returns {Promise<PushResult>} Resolves successfully when push completes with a detailed description of the operation from the server.
|
|
2521
2511
|
* @see PushResult
|
|
@@ -2533,7 +2523,7 @@ export function pull({ fs: _fs, http, onProgress, onMessage, onAuth, onAuthSucce
|
|
|
2533
2523
|
* console.log(pushResult)
|
|
2534
2524
|
*
|
|
2535
2525
|
*/
|
|
2536
|
-
export function push({ fs, http, onProgress, onMessage, onAuth, onAuthSuccess, onAuthFailure, onPrePush, dir, gitdir, ref, remoteRef, remote, url, force, delete: _delete, corsProxy, headers, cache, }: {
|
|
2526
|
+
export function push({ fs, http, onProgress, onMessage, onAuth, onAuthSuccess, onAuthFailure, onPrePush, dir, gitdir, ref, remoteRef, remote, url, force, delete: _delete, corsProxy, headers, cache, signal, }: {
|
|
2537
2527
|
fs: FsClient;
|
|
2538
2528
|
http: HttpClient;
|
|
2539
2529
|
onProgress?: ProgressCallback | undefined;
|
|
@@ -2555,6 +2545,7 @@ export function push({ fs, http, onProgress, onMessage, onAuth, onAuthSuccess, o
|
|
|
2555
2545
|
[x: string]: string;
|
|
2556
2546
|
} | undefined;
|
|
2557
2547
|
cache?: object;
|
|
2548
|
+
signal?: AbortSignal | undefined;
|
|
2558
2549
|
}): Promise<PushResult>;
|
|
2559
2550
|
/**
|
|
2560
2551
|
*
|
|
@@ -4503,7 +4494,7 @@ declare namespace NoCommitError {
|
|
|
4503
4494
|
* @property {Object} [agent] - An HTTP or HTTPS agent that manages connections for the HTTP client (Node.js only)
|
|
4504
4495
|
* @property {AsyncIterableIterator<Uint8Array>} [body] - An async iterator of Uint8Arrays that make up the body of POST requests
|
|
4505
4496
|
* @property {ProgressCallback} [onProgress] - Reserved for future use (emitting `GitProgressEvent`s)
|
|
4506
|
-
* @property {
|
|
4497
|
+
* @property {AbortSignal} [signal] - Signal to abort the HTTP request
|
|
4507
4498
|
* @property {Object} [fetchOptions={}] - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
4508
4499
|
*/
|
|
4509
4500
|
/**
|