isomorphic-git 1.41.8 → 1.42.0

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.
@@ -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 {object} [signal] - Reserved for future use (canceling a request)
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)
@@ -34,9 +34,9 @@ export type GitHttpRequest = {
34
34
  */
35
35
  onProgress?: ProgressCallback | undefined;
36
36
  /**
37
- * - Reserved for future use (canceling a request)
37
+ * - Signal to abort the HTTP request
38
38
  */
39
- signal?: object;
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>;
@@ -33,9 +33,9 @@ export type GitHttpRequest = {
33
33
  */
34
34
  onProgress?: ProgressCallback | undefined;
35
35
  /**
36
- * - Reserved for future use (canceling a request)
36
+ * - Signal to abort the HTTP request
37
37
  */
38
- signal?: object;
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>;
@@ -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 {object} [signal] - Reserved for future use (canceling a request)
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)
@@ -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 {object} [signal] - Reserved for future use (canceling a request)
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, { ...fetchOptions, method, headers, body });
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
@@ -34,9 +34,9 @@ export type GitHttpRequest = {
34
34
  */
35
35
  onProgress?: ProgressCallback | undefined;
36
36
  /**
37
- * - Reserved for future use (canceling a request)
37
+ * - Signal to abort the HTTP request
38
38
  */
39
- signal?: object;
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>;
@@ -33,9 +33,9 @@ export type GitHttpRequest = {
33
33
  */
34
34
  onProgress?: ProgressCallback | undefined;
35
35
  /**
36
- * - Reserved for future use (canceling a request)
36
+ * - Signal to abort the HTTP request
37
37
  */
38
- signal?: object;
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 {object} [signal] - Reserved for future use (canceling a request)
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, { ...fetchOptions, method, headers, body });
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
@@ -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 {object} [signal] - Reserved for future use (canceling a request)
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, { ...fetchOptions, method, headers, body });
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 {object} [signal] - Reserved for future use (canceling a request)
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
 
@@ -7123,11 +7123,17 @@ const worthWalking = (filepath, root) => {
7123
7123
  if (filepath === '.' || root == null || root.length === 0 || root === '.') {
7124
7124
  return true
7125
7125
  }
7126
- if (root.length >= filepath.length) {
7127
- return root.startsWith(filepath)
7128
- } else {
7129
- return filepath.startsWith(root)
7126
+ // A shared prefix only counts when it lands on a path component boundary,
7127
+ // otherwise the root 'src' would also pull in 'src2/a.js' and 'srcfoo.txt'.
7128
+ const base = root.endsWith('/') ? root.slice(0, -1) : root;
7129
+ if (base === '.') {
7130
+ return true
7131
+ }
7132
+ if (base.length >= filepath.length) {
7133
+ // Keep walking while filepath is still an ancestor of the wanted root.
7134
+ return base === filepath || base.startsWith(`${filepath}/`)
7130
7135
  }
7136
+ return filepath.startsWith(`${base}/`)
7131
7137
  };
7132
7138
 
7133
7139
  // @ts-check
@@ -9391,6 +9397,7 @@ class GitRemoteHTTP {
9391
9397
  * @param {string} args.service - The Git service (e.g., "git-upload-pack").
9392
9398
  * @param {string} args.url - The URL of the remote repository.
9393
9399
  * @param {Object<string, string>} args.headers - HTTP headers to include in the request.
9400
+ * @param {AbortSignal} [args.signal] - Signal to abort the operation.
9394
9401
  * @param {1 | 2} args.protocolVersion - The Git protocol version to use.
9395
9402
  * @returns {Promise<Object>} - The parsed response from the remote repository.
9396
9403
  * @throws {HttpError} - If the HTTP request fails.
@@ -9407,6 +9414,7 @@ class GitRemoteHTTP {
9407
9414
  service,
9408
9415
  url: _origUrl,
9409
9416
  headers,
9417
+ signal,
9410
9418
  protocolVersion,
9411
9419
  }) {
9412
9420
  let { url, auth } = extractAuthFromUrl(_origUrl);
@@ -9427,6 +9435,7 @@ class GitRemoteHTTP {
9427
9435
  method: 'GET',
9428
9436
  url: `${proxifiedURL}/info/refs?service=${service}`,
9429
9437
  headers,
9438
+ signal,
9430
9439
  });
9431
9440
 
9432
9441
  // the default loop behavior
@@ -9502,6 +9511,7 @@ class GitRemoteHTTP {
9502
9511
  * @param {Object<string, string>} [args.headers] - HTTP headers to include in the request.
9503
9512
  * @param {any} args.body - The request body to send.
9504
9513
  * @param {any} args.auth - Authentication credentials.
9514
+ * @param {AbortSignal} [args.signal] - Signal to abort the operation.
9505
9515
  * @returns {Promise<GitHttpResponse>} - The HTTP response from the remote repository.
9506
9516
  * @throws {HttpError} - If the HTTP request fails.
9507
9517
  */
@@ -9514,6 +9524,7 @@ class GitRemoteHTTP {
9514
9524
  auth,
9515
9525
  body,
9516
9526
  headers,
9527
+ signal,
9517
9528
  }) {
9518
9529
  // We already have the "correct" auth value at this point, but
9519
9530
  // we need to strip out the username/password from the URL yet again.
@@ -9532,6 +9543,7 @@ class GitRemoteHTTP {
9532
9543
  url: `${url}/${service}`,
9533
9544
  body,
9534
9545
  headers,
9546
+ signal,
9535
9547
  });
9536
9548
  if (res.statusCode !== 200) {
9537
9549
  const { response } = stringifyBody(res);
@@ -9767,8 +9779,8 @@ function filterCapabilities(server, client) {
9767
9779
 
9768
9780
  const pkg = {
9769
9781
  name: 'isomorphic-git',
9770
- version: '1.41.8',
9771
- agent: 'git/isomorphic-git@1.41.8',
9782
+ version: '1.42.0',
9783
+ agent: 'git/isomorphic-git@1.42.0',
9772
9784
  };
9773
9785
 
9774
9786
  class FIFO {
@@ -12077,6 +12089,30 @@ async function getConfigAll({
12077
12089
  *
12078
12090
  */
12079
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
+
12080
12116
  /**
12081
12117
  * List a remote servers branches, tags, and capabilities.
12082
12118
  *
@@ -12141,25 +12177,11 @@ async function getRemoteInfo({
12141
12177
  // Convert the flat list into an object tree, because I figure 99% of the time
12142
12178
  // that will be easier to use.
12143
12179
  for (const [ref, oid] of remote.refs) {
12144
- const parts = ref.split('/');
12145
- const last = parts.pop();
12146
- let o = result;
12147
- for (const part of parts) {
12148
- o[part] = o[part] || {};
12149
- o = o[part];
12150
- }
12151
- o[last] = oid;
12180
+ assignRefPath(result, ref, oid);
12152
12181
  }
12153
12182
  // Merge symrefs on top of refs to more closely match actual git repo layouts
12154
12183
  for (const [symref, ref] of remote.symrefs) {
12155
- const parts = symref.split('/');
12156
- const last = parts.pop();
12157
- let o = result;
12158
- for (const part of parts) {
12159
- o[part] = o[part] || {};
12160
- o = o[part];
12161
- }
12162
- o[last] = ref;
12184
+ assignRefPath(result, symref, ref);
12163
12185
  }
12164
12186
  return result
12165
12187
  } catch (err) {
@@ -14333,6 +14355,7 @@ async function writeReceivePackRequest({
14333
14355
  * @param {boolean} [args.delete = false]
14334
14356
  * @param {string} [args.url]
14335
14357
  * @param {string} [args.corsProxy]
14358
+ * @param {AbortSignal} [args.signal]
14336
14359
  * @param {Object<string, string>} [args.headers]
14337
14360
  *
14338
14361
  * @returns {Promise<PushResult>}
@@ -14356,6 +14379,7 @@ async function _push({
14356
14379
  delete: _delete = false,
14357
14380
  corsProxy,
14358
14381
  headers = {},
14382
+ signal,
14359
14383
  }) {
14360
14384
  const ref = _ref || (await _currentBranch({ fs, gitdir }));
14361
14385
  if (typeof ref === 'undefined') {
@@ -14404,6 +14428,7 @@ async function _push({
14404
14428
  url,
14405
14429
  headers,
14406
14430
  protocolVersion: 1,
14431
+ signal,
14407
14432
  });
14408
14433
  const auth = httpRemote.auth; // hack to get new credentials from CredentialManager API
14409
14434
  let fullRemoteRef;
@@ -14559,6 +14584,7 @@ async function _push({
14559
14584
  auth,
14560
14585
  headers,
14561
14586
  body: [...packstream1, ...packstream2],
14587
+ signal,
14562
14588
  });
14563
14589
  const { packfile, progress } = await GitSideBand.demux(res.body);
14564
14590
  if (onMessage) {
@@ -14635,6 +14661,7 @@ async function _push({
14635
14661
  * @param {string} [args.corsProxy] - Optional [CORS proxy](https://www.npmjs.com/%40isomorphic-git/cors-proxy). Overrides value in repo config.
14636
14662
  * @param {Object<string, string>} [args.headers] - Additional headers to include in HTTP requests, similar to git's `extraHeader` config
14637
14663
  * @param {object} [args.cache] - a [cache](cache.md) object
14664
+ * @param {AbortSignal} [args.signal] - Optional signal to abort the push operation
14638
14665
  *
14639
14666
  * @returns {Promise<PushResult>} Resolves successfully when push completes with a detailed description of the operation from the server.
14640
14667
  * @see PushResult
@@ -14672,6 +14699,7 @@ async function push({
14672
14699
  corsProxy,
14673
14700
  headers = {},
14674
14701
  cache = {},
14702
+ signal,
14675
14703
  }) {
14676
14704
  try {
14677
14705
  assertParameter('fs', fs);
@@ -14699,6 +14727,7 @@ async function push({
14699
14727
  delete: _delete,
14700
14728
  corsProxy,
14701
14729
  headers,
14730
+ signal,
14702
14731
  })
14703
14732
  } catch (err) {
14704
14733
  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
- * - Reserved for future use (canceling a request)
305
+ * - Signal to abort the HTTP request
306
306
  */
307
- signal?: object;
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 {object} [signal] - Reserved for future use (canceling a request)
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
- * - Reserved for future use (canceling a request)
304
+ * - Signal to abort the HTTP request
305
305
  */
306
- signal?: object;
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 {object} [signal] - Reserved for future use (canceling a request)
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
  /**