isomorphic-git 1.25.0 → 1.25.2

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.
@@ -1,12 +1,10 @@
1
1
  [
2
- "X Chrome Headless 79.0.3945.0 (Linux x86_64)",
3
- "Firefox 119.0 (Ubuntu 0.0.0)",
4
- "Chrome 117.0.0.0 (Android 10)",
5
- "Edge 79.0.309.65 (Windows 10)",
6
- "X Safari 13.1 (Mac OS 10.15.4)",
7
- "X Mobile Safari 13.0 (iOS 13.0)",
8
2
  "Chrome Headless 79.0.3945.0 (Linux x86_64)",
9
- "Chrome 117.0.0.0 (Android 10)",
3
+ "Firefox 121.0 (Ubuntu 0.0.0)",
4
+ "X Chrome 117.0.0.0 (Android 10)",
5
+ "Edge 79.0.309.65 (Windows 10)",
10
6
  "Safari 13.1 (Mac OS 10.15.4)",
11
- "Mobile Safari 13.0 (iOS 13.0)"
7
+ "Mobile Safari 13.0 (iOS 13.0)",
8
+ "Chrome Headless 79.0.3945.0 (Linux x86_64)",
9
+ "Chrome 117.0.0.0 (Android 10)"
12
10
  ]
@@ -213,15 +213,19 @@ async function request({
213
213
  },
214
214
  (err, res) => {
215
215
  if (err) return reject(err)
216
- const iter = fromNodeStream(res);
217
- resolve({
218
- url: res.url,
219
- method: res.method,
220
- statusCode: res.statusCode,
221
- statusMessage: res.statusMessage,
222
- body: iter,
223
- headers: res.headers,
224
- });
216
+ try {
217
+ const iter = fromNodeStream(res);
218
+ resolve({
219
+ url: res.url,
220
+ method: res.method,
221
+ statusCode: res.statusCode,
222
+ statusMessage: res.statusMessage,
223
+ body: iter,
224
+ headers: res.headers,
225
+ });
226
+ } catch (e) {
227
+ reject(e);
228
+ }
225
229
  }
226
230
  );
227
231
  })
@@ -207,15 +207,19 @@ async function request({
207
207
  },
208
208
  (err, res) => {
209
209
  if (err) return reject(err)
210
- const iter = fromNodeStream(res);
211
- resolve({
212
- url: res.url,
213
- method: res.method,
214
- statusCode: res.statusCode,
215
- statusMessage: res.statusMessage,
216
- body: iter,
217
- headers: res.headers,
218
- });
210
+ try {
211
+ const iter = fromNodeStream(res);
212
+ resolve({
213
+ url: res.url,
214
+ method: res.method,
215
+ statusCode: res.statusCode,
216
+ statusMessage: res.statusMessage,
217
+ body: iter,
218
+ headers: res.headers,
219
+ });
220
+ } catch (e) {
221
+ reject(e);
222
+ }
219
223
  }
220
224
  );
221
225
  })
package/index.cjs CHANGED
@@ -2457,6 +2457,7 @@ class StreamReader {
2457
2457
  let { done, value } = await this.stream.next();
2458
2458
  if (done) {
2459
2459
  this._ended = true;
2460
+ if (!value) return Buffer.alloc(0)
2460
2461
  }
2461
2462
  if (value) {
2462
2463
  value = Buffer.from(value);
@@ -6839,7 +6840,7 @@ class GitPktLine {
6839
6840
  if (buffer == null) return true
6840
6841
  return buffer
6841
6842
  } catch (err) {
6842
- console.log('error', err);
6843
+ stream.error = err;
6843
6844
  return true
6844
6845
  }
6845
6846
  }
@@ -7316,8 +7317,8 @@ function filterCapabilities(server, client) {
7316
7317
 
7317
7318
  const pkg = {
7318
7319
  name: 'isomorphic-git',
7319
- version: '1.25.0',
7320
- agent: 'git/isomorphic-git@1.25.0',
7320
+ version: '1.25.2',
7321
+ agent: 'git/isomorphic-git@1.25.2',
7321
7322
  };
7322
7323
 
7323
7324
  class FIFO {
@@ -7348,8 +7349,8 @@ class FIFO {
7348
7349
  }
7349
7350
 
7350
7351
  destroy(err) {
7351
- this._ended = true;
7352
7352
  this.error = err;
7353
+ this.end();
7353
7354
  }
7354
7355
 
7355
7356
  async next() {
@@ -7444,7 +7445,7 @@ class GitSideBand {
7444
7445
  if (line === true) {
7445
7446
  packetlines.end();
7446
7447
  progress.end();
7447
- packfile.end();
7448
+ input.error ? packfile.destroy(input.error) : packfile.end();
7448
7449
  return
7449
7450
  }
7450
7451
  // Examine first byte to determine which output "stream" to use
@@ -7463,12 +7464,14 @@ class GitSideBand {
7463
7464
  // fatal error message just before stream aborts
7464
7465
  const error = line.slice(1);
7465
7466
  progress.write(error);
7467
+ packetlines.end();
7468
+ progress.end();
7466
7469
  packfile.destroy(new Error(error.toString('utf8')));
7467
7470
  return
7468
7471
  }
7469
7472
  default: {
7470
7473
  // Not part of the side-band-64k protocol
7471
- packetlines.write(line.slice(0));
7474
+ packetlines.write(line);
7472
7475
  }
7473
7476
  }
7474
7477
  // Careful not to blow up the stack.
@@ -7581,9 +7584,20 @@ async function parseUploadPackResponse(stream) {
7581
7584
  } else if (line.startsWith('NAK')) {
7582
7585
  nak = true;
7583
7586
  done = true;
7587
+ } else {
7588
+ done = true;
7589
+ nak = true;
7584
7590
  }
7585
7591
  if (done) {
7586
- resolve({ shallows, unshallows, acks, nak, packfile, progress });
7592
+ stream.error
7593
+ ? reject(stream.error)
7594
+ : resolve({ shallows, unshallows, acks, nak, packfile, progress });
7595
+ }
7596
+ }).finally(() => {
7597
+ if (!done) {
7598
+ stream.error
7599
+ ? reject(stream.error)
7600
+ : resolve({ shallows, unshallows, acks, nak, packfile, progress });
7587
7601
  }
7588
7602
  });
7589
7603
  })
@@ -7949,6 +7963,7 @@ async function _fetch({
7949
7963
  });
7950
7964
  }
7951
7965
  const packfile = Buffer.from(await collect(response.packfile));
7966
+ if (raw.body.error) throw raw.body.error
7952
7967
  const packfileSha = packfile.slice(-20).toString('hex');
7953
7968
  const res = {
7954
7969
  defaultBranch: response.HEAD,
package/index.js CHANGED
@@ -2451,6 +2451,7 @@ class StreamReader {
2451
2451
  let { done, value } = await this.stream.next();
2452
2452
  if (done) {
2453
2453
  this._ended = true;
2454
+ if (!value) return Buffer.alloc(0)
2454
2455
  }
2455
2456
  if (value) {
2456
2457
  value = Buffer.from(value);
@@ -6833,7 +6834,7 @@ class GitPktLine {
6833
6834
  if (buffer == null) return true
6834
6835
  return buffer
6835
6836
  } catch (err) {
6836
- console.log('error', err);
6837
+ stream.error = err;
6837
6838
  return true
6838
6839
  }
6839
6840
  }
@@ -7310,8 +7311,8 @@ function filterCapabilities(server, client) {
7310
7311
 
7311
7312
  const pkg = {
7312
7313
  name: 'isomorphic-git',
7313
- version: '1.25.0',
7314
- agent: 'git/isomorphic-git@1.25.0',
7314
+ version: '1.25.2',
7315
+ agent: 'git/isomorphic-git@1.25.2',
7315
7316
  };
7316
7317
 
7317
7318
  class FIFO {
@@ -7342,8 +7343,8 @@ class FIFO {
7342
7343
  }
7343
7344
 
7344
7345
  destroy(err) {
7345
- this._ended = true;
7346
7346
  this.error = err;
7347
+ this.end();
7347
7348
  }
7348
7349
 
7349
7350
  async next() {
@@ -7438,7 +7439,7 @@ class GitSideBand {
7438
7439
  if (line === true) {
7439
7440
  packetlines.end();
7440
7441
  progress.end();
7441
- packfile.end();
7442
+ input.error ? packfile.destroy(input.error) : packfile.end();
7442
7443
  return
7443
7444
  }
7444
7445
  // Examine first byte to determine which output "stream" to use
@@ -7457,12 +7458,14 @@ class GitSideBand {
7457
7458
  // fatal error message just before stream aborts
7458
7459
  const error = line.slice(1);
7459
7460
  progress.write(error);
7461
+ packetlines.end();
7462
+ progress.end();
7460
7463
  packfile.destroy(new Error(error.toString('utf8')));
7461
7464
  return
7462
7465
  }
7463
7466
  default: {
7464
7467
  // Not part of the side-band-64k protocol
7465
- packetlines.write(line.slice(0));
7468
+ packetlines.write(line);
7466
7469
  }
7467
7470
  }
7468
7471
  // Careful not to blow up the stack.
@@ -7575,9 +7578,20 @@ async function parseUploadPackResponse(stream) {
7575
7578
  } else if (line.startsWith('NAK')) {
7576
7579
  nak = true;
7577
7580
  done = true;
7581
+ } else {
7582
+ done = true;
7583
+ nak = true;
7578
7584
  }
7579
7585
  if (done) {
7580
- resolve({ shallows, unshallows, acks, nak, packfile, progress });
7586
+ stream.error
7587
+ ? reject(stream.error)
7588
+ : resolve({ shallows, unshallows, acks, nak, packfile, progress });
7589
+ }
7590
+ }).finally(() => {
7591
+ if (!done) {
7592
+ stream.error
7593
+ ? reject(stream.error)
7594
+ : resolve({ shallows, unshallows, acks, nak, packfile, progress });
7581
7595
  }
7582
7596
  });
7583
7597
  })
@@ -7943,6 +7957,7 @@ async function _fetch({
7943
7957
  });
7944
7958
  }
7945
7959
  const packfile = Buffer.from(await collect(response.packfile));
7960
+ if (raw.body.error) throw raw.body.error
7946
7961
  const packfileSha = packfile.slice(-20).toString('hex');
7947
7962
  const res = {
7948
7963
  defaultBranch: response.HEAD,