isomorphic-git 1.25.1 → 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,11 +1,10 @@
1
1
  [
2
2
  "Chrome Headless 79.0.3945.0 (Linux x86_64)",
3
- "X Firefox 120.0 (Ubuntu 0.0.0)",
4
- "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
5
  "Edge 79.0.309.65 (Windows 10)",
6
6
  "Safari 13.1 (Mac OS 10.15.4)",
7
7
  "Mobile Safari 13.0 (iOS 13.0)",
8
8
  "Chrome Headless 79.0.3945.0 (Linux x86_64)",
9
- "Firefox 120.0 (Ubuntu 0.0.0)",
10
9
  "Chrome 117.0.0.0 (Android 10)"
11
10
  ]
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.1',
7320
- agent: 'git/isomorphic-git@1.25.1',
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.
@@ -7586,7 +7589,15 @@ async function parseUploadPackResponse(stream) {
7586
7589
  nak = true;
7587
7590
  }
7588
7591
  if (done) {
7589
- 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 });
7590
7601
  }
7591
7602
  });
7592
7603
  })
@@ -7952,6 +7963,7 @@ async function _fetch({
7952
7963
  });
7953
7964
  }
7954
7965
  const packfile = Buffer.from(await collect(response.packfile));
7966
+ if (raw.body.error) throw raw.body.error
7955
7967
  const packfileSha = packfile.slice(-20).toString('hex');
7956
7968
  const res = {
7957
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.1',
7314
- agent: 'git/isomorphic-git@1.25.1',
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.
@@ -7580,7 +7583,15 @@ async function parseUploadPackResponse(stream) {
7580
7583
  nak = true;
7581
7584
  }
7582
7585
  if (done) {
7583
- 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 });
7584
7595
  }
7585
7596
  });
7586
7597
  })
@@ -7946,6 +7957,7 @@ async function _fetch({
7946
7957
  });
7947
7958
  }
7948
7959
  const packfile = Buffer.from(await collect(response.packfile));
7960
+ if (raw.body.error) throw raw.body.error
7949
7961
  const packfileSha = packfile.slice(-20).toString('hex');
7950
7962
  const res = {
7951
7963
  defaultBranch: response.HEAD,