isomorphic-git 1.24.3 → 1.24.5

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,8 @@
1
1
  [
2
- "Chrome Headless 79.0.3945.0 (Linux x86_64)",
3
- "X Firefox 115.0 (Ubuntu 0.0.0)",
4
- "Edge 79.0.309.65 (Windows 10)",
5
- "Safari 13.1 (Mac OS 10.15.4)",
6
- "Mobile Safari 13.0 (iOS 13.0)",
7
- "X Chrome 111.0.0.0 (Android 10)",
8
2
  "Chrome Headless 79.0.3945.0 (Linux x86_64)",
9
3
  "Firefox 115.0 (Ubuntu 0.0.0)",
10
- "Chrome 111.0.0.0 (Android 10)"
4
+ "Chrome 114.0.0.0 (Android 10)",
5
+ "Safari 13.1 (Mac OS 10.15.4)",
6
+ "Edge 79.0.309.65 (Windows 10)",
7
+ "Mobile Safari 13.0 (iOS 13.0)"
11
8
  ]
package/index.cjs CHANGED
@@ -4400,6 +4400,18 @@ async function rmRecursive(fs, filepath) {
4400
4400
  }
4401
4401
  }
4402
4402
 
4403
+ function isPromiseLike(obj) {
4404
+ return isObject(obj) && isFunction(obj.then) && isFunction(obj.catch)
4405
+ }
4406
+
4407
+ function isObject(obj) {
4408
+ return obj && typeof obj === 'object'
4409
+ }
4410
+
4411
+ function isFunction(obj) {
4412
+ return typeof obj === 'function'
4413
+ }
4414
+
4403
4415
  function isPromiseFs(fs) {
4404
4416
  const test = targetFs => {
4405
4417
  try {
@@ -4410,7 +4422,7 @@ function isPromiseFs(fs) {
4410
4422
  return e
4411
4423
  }
4412
4424
  };
4413
- return test(fs).constructor.name === 'Promise'
4425
+ return isPromiseLike(test(fs))
4414
4426
  }
4415
4427
 
4416
4428
  // List of commands all filesystems are expected to provide. `rm` is not
@@ -7301,8 +7313,8 @@ function filterCapabilities(server, client) {
7301
7313
 
7302
7314
  const pkg = {
7303
7315
  name: 'isomorphic-git',
7304
- version: '1.24.3',
7305
- agent: 'git/isomorphic-git@1.24.3',
7316
+ version: '1.24.5',
7317
+ agent: 'git/isomorphic-git@1.24.5',
7306
7318
  };
7307
7319
 
7308
7320
  class FIFO {
@@ -8625,15 +8637,20 @@ async function _expandOid({ fs, cache, gitdir, oid: short }) {
8625
8637
  // process can acquire external ref-deltas.
8626
8638
  const getExternalRefDelta = oid => _readObject({ fs, cache, gitdir, oid });
8627
8639
 
8628
- const results1 = await expandOidLoose({ fs, gitdir, oid: short });
8629
- const results2 = await expandOidPacked({
8640
+ const results = await expandOidLoose({ fs, gitdir, oid: short });
8641
+ const packedOids = await expandOidPacked({
8630
8642
  fs,
8631
8643
  cache,
8632
8644
  gitdir,
8633
8645
  oid: short,
8634
8646
  getExternalRefDelta,
8635
8647
  });
8636
- const results = results1.concat(results2);
8648
+ // Objects can exist in a pack file as well as loose, make sure we only get a list of unique oids.
8649
+ for (const packedOid of packedOids) {
8650
+ if (results.indexOf(packedOid) === -1) {
8651
+ results.push(packedOid);
8652
+ }
8653
+ }
8637
8654
 
8638
8655
  if (results.length === 1) {
8639
8656
  return results[0]
package/index.js CHANGED
@@ -4394,6 +4394,18 @@ async function rmRecursive(fs, filepath) {
4394
4394
  }
4395
4395
  }
4396
4396
 
4397
+ function isPromiseLike(obj) {
4398
+ return isObject(obj) && isFunction(obj.then) && isFunction(obj.catch)
4399
+ }
4400
+
4401
+ function isObject(obj) {
4402
+ return obj && typeof obj === 'object'
4403
+ }
4404
+
4405
+ function isFunction(obj) {
4406
+ return typeof obj === 'function'
4407
+ }
4408
+
4397
4409
  function isPromiseFs(fs) {
4398
4410
  const test = targetFs => {
4399
4411
  try {
@@ -4404,7 +4416,7 @@ function isPromiseFs(fs) {
4404
4416
  return e
4405
4417
  }
4406
4418
  };
4407
- return test(fs).constructor.name === 'Promise'
4419
+ return isPromiseLike(test(fs))
4408
4420
  }
4409
4421
 
4410
4422
  // List of commands all filesystems are expected to provide. `rm` is not
@@ -7295,8 +7307,8 @@ function filterCapabilities(server, client) {
7295
7307
 
7296
7308
  const pkg = {
7297
7309
  name: 'isomorphic-git',
7298
- version: '1.24.3',
7299
- agent: 'git/isomorphic-git@1.24.3',
7310
+ version: '1.24.5',
7311
+ agent: 'git/isomorphic-git@1.24.5',
7300
7312
  };
7301
7313
 
7302
7314
  class FIFO {
@@ -8619,15 +8631,20 @@ async function _expandOid({ fs, cache, gitdir, oid: short }) {
8619
8631
  // process can acquire external ref-deltas.
8620
8632
  const getExternalRefDelta = oid => _readObject({ fs, cache, gitdir, oid });
8621
8633
 
8622
- const results1 = await expandOidLoose({ fs, gitdir, oid: short });
8623
- const results2 = await expandOidPacked({
8634
+ const results = await expandOidLoose({ fs, gitdir, oid: short });
8635
+ const packedOids = await expandOidPacked({
8624
8636
  fs,
8625
8637
  cache,
8626
8638
  gitdir,
8627
8639
  oid: short,
8628
8640
  getExternalRefDelta,
8629
8641
  });
8630
- const results = results1.concat(results2);
8642
+ // Objects can exist in a pack file as well as loose, make sure we only get a list of unique oids.
8643
+ for (const packedOid of packedOids) {
8644
+ if (results.indexOf(packedOid) === -1) {
8645
+ results.push(packedOid);
8646
+ }
8647
+ }
8631
8648
 
8632
8649
  if (results.length === 1) {
8633
8650
  return results[0]