isomorphic-git 1.19.1 → 1.19.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,8 +1,8 @@
1
1
  [
2
2
  "Chrome Headless 79.0.3945.0 (Linux x86_64)",
3
- "Firefox 102.0 (Ubuntu 0.0.0)",
4
- "Chrome 100.0.4896.127 (Android 10)",
5
- "Mobile Safari 13.0 (iOS 13.0)",
3
+ "Firefox 103.0 (Ubuntu 0.0.0)",
6
4
  "Edge 79.0.309.65 (Windows 10)",
7
- "Safari 13.1 (Mac OS 10.15.4)"
5
+ "Chrome 103.0.5060.53 (Android 10)",
6
+ "Safari 13.1 (Mac OS 10.15.4)",
7
+ "Mobile Safari 13.0 (iOS 13.0)"
8
8
  ]
package/index.cjs CHANGED
@@ -3919,7 +3919,7 @@ class GitWalkerRepo {
3919
3919
  * @param {string} [args.ref='HEAD']
3920
3920
  * @returns {Walker}
3921
3921
  */
3922
- function TREE({ ref = 'HEAD' }) {
3922
+ function TREE({ ref = 'HEAD' } = {}) {
3923
3923
  const o = Object.create(null);
3924
3924
  Object.defineProperty(o, GitWalkSymbol, {
3925
3925
  value: function({ fs, gitdir, cache }) {
@@ -4489,6 +4489,12 @@ function assertParameter(name, value) {
4489
4489
  }
4490
4490
  }
4491
4491
 
4492
+ function posixifyPathBuffer(buffer) {
4493
+ let idx;
4494
+ while (~(idx = buffer.indexOf(92))) buffer[idx] = 47;
4495
+ return buffer
4496
+ }
4497
+
4492
4498
  // @ts-check
4493
4499
 
4494
4500
  /**
@@ -4565,7 +4571,7 @@ async function addToIndex({ dir, gitdir, fs, filepath, index, force }) {
4565
4571
  await Promise.all(promises);
4566
4572
  } else {
4567
4573
  const object = stats.isSymbolicLink()
4568
- ? await fs.readlink(join(dir, currentFilepath))
4574
+ ? await fs.readlink(join(dir, currentFilepath)).then(posixifyPathBuffer)
4569
4575
  : await fs.read(join(dir, currentFilepath));
4570
4576
  if (object === null) throw new NotFoundError(currentFilepath)
4571
4577
  const oid = await _writeObject({ fs, gitdir, type: 'blob', object });
@@ -6984,8 +6990,8 @@ function filterCapabilities(server, client) {
6984
6990
 
6985
6991
  const pkg = {
6986
6992
  name: 'isomorphic-git',
6987
- version: '1.19.1',
6988
- agent: 'git/isomorphic-git@1.19.1',
6993
+ version: '1.19.2',
6994
+ agent: 'git/isomorphic-git@1.19.2',
6989
6995
  };
6990
6996
 
6991
6997
  class FIFO {
@@ -11813,6 +11819,7 @@ async function _push({
11813
11819
  }
11814
11820
  }
11815
11821
 
11822
+ if (oid === oldoid) force = true;
11816
11823
  if (!force) {
11817
11824
  // Is it a tag that already exists?
11818
11825
  if (
@@ -14032,12 +14039,14 @@ function version() {
14032
14039
  *
14033
14040
  * Example 2: Return the difference between the working directory and the HEAD commit
14034
14041
  * ```js
14035
- * const diff = require('diff-lines')
14036
- * async function map(filepath, [head, workdir]) {
14042
+ * const map = async (filepath, [head, workdir]) => {
14037
14043
  * return {
14038
14044
  * filepath,
14039
- * oid: await head.oid(),
14040
- * diff: diff((await head.content()).toString('utf8'), (await workdir.content()).toString('utf8'))
14045
+ * oid: await head?.oid(),
14046
+ * diff: diff(
14047
+ * (await head?.content())?.toString('utf8') || '',
14048
+ * (await workdir?.content())?.toString('utf8') || ''
14049
+ * )
14041
14050
  * }
14042
14051
  * }
14043
14052
  * ```
package/index.d.ts CHANGED
@@ -752,7 +752,7 @@ export function STAGE(): Walker;
752
752
  * @param {string} [args.ref='HEAD']
753
753
  * @returns {Walker}
754
754
  */
755
- export function TREE({ ref }: {
755
+ export function TREE({ ref }?: {
756
756
  ref?: string;
757
757
  }): Walker;
758
758
  /**
@@ -3415,12 +3415,14 @@ export function version(): string;
3415
3415
  *
3416
3416
  * Example 2: Return the difference between the working directory and the HEAD commit
3417
3417
  * ```js
3418
- * const diff = require('diff-lines')
3419
- * async function map(filepath, [head, workdir]) {
3418
+ * const map = async (filepath, [head, workdir]) => {
3420
3419
  * return {
3421
3420
  * filepath,
3422
- * oid: await head.oid(),
3423
- * diff: diff((await head.content()).toString('utf8'), (await workdir.content()).toString('utf8'))
3421
+ * oid: await head?.oid(),
3422
+ * diff: diff(
3423
+ * (await head?.content())?.toString('utf8') || '',
3424
+ * (await workdir?.content())?.toString('utf8') || ''
3425
+ * )
3424
3426
  * }
3425
3427
  * }
3426
3428
  * ```
package/index.js CHANGED
@@ -3913,7 +3913,7 @@ class GitWalkerRepo {
3913
3913
  * @param {string} [args.ref='HEAD']
3914
3914
  * @returns {Walker}
3915
3915
  */
3916
- function TREE({ ref = 'HEAD' }) {
3916
+ function TREE({ ref = 'HEAD' } = {}) {
3917
3917
  const o = Object.create(null);
3918
3918
  Object.defineProperty(o, GitWalkSymbol, {
3919
3919
  value: function({ fs, gitdir, cache }) {
@@ -4483,6 +4483,12 @@ function assertParameter(name, value) {
4483
4483
  }
4484
4484
  }
4485
4485
 
4486
+ function posixifyPathBuffer(buffer) {
4487
+ let idx;
4488
+ while (~(idx = buffer.indexOf(92))) buffer[idx] = 47;
4489
+ return buffer
4490
+ }
4491
+
4486
4492
  // @ts-check
4487
4493
 
4488
4494
  /**
@@ -4559,7 +4565,7 @@ async function addToIndex({ dir, gitdir, fs, filepath, index, force }) {
4559
4565
  await Promise.all(promises);
4560
4566
  } else {
4561
4567
  const object = stats.isSymbolicLink()
4562
- ? await fs.readlink(join(dir, currentFilepath))
4568
+ ? await fs.readlink(join(dir, currentFilepath)).then(posixifyPathBuffer)
4563
4569
  : await fs.read(join(dir, currentFilepath));
4564
4570
  if (object === null) throw new NotFoundError(currentFilepath)
4565
4571
  const oid = await _writeObject({ fs, gitdir, type: 'blob', object });
@@ -6978,8 +6984,8 @@ function filterCapabilities(server, client) {
6978
6984
 
6979
6985
  const pkg = {
6980
6986
  name: 'isomorphic-git',
6981
- version: '1.19.1',
6982
- agent: 'git/isomorphic-git@1.19.1',
6987
+ version: '1.19.2',
6988
+ agent: 'git/isomorphic-git@1.19.2',
6983
6989
  };
6984
6990
 
6985
6991
  class FIFO {
@@ -11807,6 +11813,7 @@ async function _push({
11807
11813
  }
11808
11814
  }
11809
11815
 
11816
+ if (oid === oldoid) force = true;
11810
11817
  if (!force) {
11811
11818
  // Is it a tag that already exists?
11812
11819
  if (
@@ -14026,12 +14033,14 @@ function version() {
14026
14033
  *
14027
14034
  * Example 2: Return the difference between the working directory and the HEAD commit
14028
14035
  * ```js
14029
- * const diff = require('diff-lines')
14030
- * async function map(filepath, [head, workdir]) {
14036
+ * const map = async (filepath, [head, workdir]) => {
14031
14037
  * return {
14032
14038
  * filepath,
14033
- * oid: await head.oid(),
14034
- * diff: diff((await head.content()).toString('utf8'), (await workdir.content()).toString('utf8'))
14039
+ * oid: await head?.oid(),
14040
+ * diff: diff(
14041
+ * (await head?.content())?.toString('utf8') || '',
14042
+ * (await workdir?.content())?.toString('utf8') || ''
14043
+ * )
14035
14044
  * }
14036
14045
  * }
14037
14046
  * ```
@@ -752,7 +752,7 @@ export function STAGE(): Walker;
752
752
  * @param {string} [args.ref='HEAD']
753
753
  * @returns {Walker}
754
754
  */
755
- export function TREE({ ref }: {
755
+ export function TREE({ ref }?: {
756
756
  ref?: string;
757
757
  }): Walker;
758
758
  /**
@@ -3415,12 +3415,14 @@ export function version(): string;
3415
3415
  *
3416
3416
  * Example 2: Return the difference between the working directory and the HEAD commit
3417
3417
  * ```js
3418
- * const diff = require('diff-lines')
3419
- * async function map(filepath, [head, workdir]) {
3418
+ * const map = async (filepath, [head, workdir]) => {
3420
3419
  * return {
3421
3420
  * filepath,
3422
- * oid: await head.oid(),
3423
- * diff: diff((await head.content()).toString('utf8'), (await workdir.content()).toString('utf8'))
3421
+ * oid: await head?.oid(),
3422
+ * diff: diff(
3423
+ * (await head?.content())?.toString('utf8') || '',
3424
+ * (await workdir?.content())?.toString('utf8') || ''
3425
+ * )
3424
3426
  * }
3425
3427
  * }
3426
3428
  * ```