isomorphic-git 1.41.4 → 1.41.7

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.
@@ -4451,6 +4451,10 @@ async function _readObject({
4451
4451
  oid,
4452
4452
  format = 'content',
4453
4453
  }) {
4454
+ if (!['deflated', 'wrapped', 'content'].includes(format)) {
4455
+ throw new InternalError(`invalid requested format "${format}"`)
4456
+ }
4457
+
4454
4458
  // Curry the current read method so that the packfile un-deltification
4455
4459
  // process can acquire external ref-deltas.
4456
4460
  const getExternalRefDelta = oid => _readObject({ fs, cache, gitdir, oid });
@@ -4510,11 +4514,7 @@ async function _readObject({
4510
4514
  result.object = object;
4511
4515
  result.format = 'content';
4512
4516
 
4513
- if (format === 'content') {
4514
- return result
4515
- }
4516
-
4517
- throw new InternalError(`invalid requested format "${format}"`)
4517
+ return result
4518
4518
  }
4519
4519
 
4520
4520
  async function resolveCommit({ fs, cache, gitdir, oid }) {
package/managers/index.js CHANGED
@@ -4438,6 +4438,10 @@ async function _readObject({
4438
4438
  oid,
4439
4439
  format = 'content',
4440
4440
  }) {
4441
+ if (!['deflated', 'wrapped', 'content'].includes(format)) {
4442
+ throw new InternalError(`invalid requested format "${format}"`)
4443
+ }
4444
+
4441
4445
  // Curry the current read method so that the packfile un-deltification
4442
4446
  // process can acquire external ref-deltas.
4443
4447
  const getExternalRefDelta = oid => _readObject({ fs, cache, gitdir, oid });
@@ -4497,11 +4501,7 @@ async function _readObject({
4497
4501
  result.object = object;
4498
4502
  result.format = 'content';
4499
4503
 
4500
- if (format === 'content') {
4501
- return result
4502
- }
4503
-
4504
- throw new InternalError(`invalid requested format "${format}"`)
4504
+ return result
4505
4505
  }
4506
4506
 
4507
4507
  async function resolveCommit({ fs, cache, gitdir, oid }) {