isomorphic-git 1.19.0 โ†’ 1.19.3

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.
package/README.md CHANGED
@@ -347,6 +347,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
347
347
  <td align="center"><a href="https://github.com/seanpoulter"><img src="https://avatars.githubusercontent.com/u/2585460?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Sean Poulter</b></sub></a><br /><a href="#maintenance-seanpoulter" title="Maintenance">๐Ÿšง</a></td>
348
348
  <td align="center"><a href="https://github.com/araknast"><img src="https://avatars.githubusercontent.com/u/84164531?v=4?s=60" width="60px;" alt=""/><br /><sub><b>araknast</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=araknast" title="Code">๐Ÿ’ป</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=araknast" title="Tests">โš ๏ธ</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=araknast" title="Documentation">๐Ÿ“–</a></td>
349
349
  <td align="center"><a href="https://github.com/rraab-dev"><img src="https://avatars.githubusercontent.com/u/53948988?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Rafael Raab</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=rraab-dev" title="Code">๐Ÿ’ป</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=rraab-dev" title="Documentation">๐Ÿ“–</a></td>
350
+ <td align="center"><a href="https://gitlab.com/CoalZombik/"><img src="https://avatars.githubusercontent.com/u/49895741?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Lukรกลก Cezner</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/issues?q=author%3ACoalZombik" title="Bug reports">๐Ÿ›</a></td>
350
351
  </tr>
351
352
  </table>
352
353
 
@@ -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)",
3
+ "Firefox 103.0 (Ubuntu 0.0.0)",
4
+ "Chrome 103.0.5060.53 (Android 10)",
4
5
  "Edge 79.0.309.65 (Windows 10)",
5
- "Chrome 100.0.4896.127 (Android 10)",
6
- "Safari 13.1 (Mac OS 10.15.4)",
7
- "Mobile Safari 13.0 (iOS 13.0)"
6
+ "Mobile Safari 13.0 (iOS 13.0)",
7
+ "Safari 13.1 (Mac OS 10.15.4)"
8
8
  ]
package/index.cjs CHANGED
@@ -2712,7 +2712,7 @@ class GitPackIndex {
2712
2712
  const objectsByDepth = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
2713
2713
  for (let offset in offsetToObject) {
2714
2714
  offset = Number(offset);
2715
- const percent = Math.floor((count++ * 100) / totalObjectCount);
2715
+ const percent = Math.floor((count * 100) / totalObjectCount);
2716
2716
  if (percent !== lastPercent) {
2717
2717
  if (onProgress) {
2718
2718
  await onProgress({
@@ -2722,6 +2722,7 @@ class GitPackIndex {
2722
2722
  });
2723
2723
  }
2724
2724
  }
2725
+ count++;
2725
2726
  lastPercent = percent;
2726
2727
 
2727
2728
  const o = offsetToObject[offset];
@@ -3918,7 +3919,7 @@ class GitWalkerRepo {
3918
3919
  * @param {string} [args.ref='HEAD']
3919
3920
  * @returns {Walker}
3920
3921
  */
3921
- function TREE({ ref = 'HEAD' }) {
3922
+ function TREE({ ref = 'HEAD' } = {}) {
3922
3923
  const o = Object.create(null);
3923
3924
  Object.defineProperty(o, GitWalkSymbol, {
3924
3925
  value: function({ fs, gitdir, cache }) {
@@ -4488,6 +4489,12 @@ function assertParameter(name, value) {
4488
4489
  }
4489
4490
  }
4490
4491
 
4492
+ function posixifyPathBuffer(buffer) {
4493
+ let idx;
4494
+ while (~(idx = buffer.indexOf(92))) buffer[idx] = 47;
4495
+ return buffer
4496
+ }
4497
+
4491
4498
  // @ts-check
4492
4499
 
4493
4500
  /**
@@ -4564,7 +4571,7 @@ async function addToIndex({ dir, gitdir, fs, filepath, index, force }) {
4564
4571
  await Promise.all(promises);
4565
4572
  } else {
4566
4573
  const object = stats.isSymbolicLink()
4567
- ? await fs.readlink(join(dir, currentFilepath))
4574
+ ? await fs.readlink(join(dir, currentFilepath)).then(posixifyPathBuffer)
4568
4575
  : await fs.read(join(dir, currentFilepath));
4569
4576
  if (object === null) throw new NotFoundError(currentFilepath)
4570
4577
  const oid = await _writeObject({ fs, gitdir, type: 'blob', object });
@@ -6983,8 +6990,8 @@ function filterCapabilities(server, client) {
6983
6990
 
6984
6991
  const pkg = {
6985
6992
  name: 'isomorphic-git',
6986
- version: '1.19.0',
6987
- agent: 'git/isomorphic-git@1.19.0',
6993
+ version: '1.19.3',
6994
+ agent: 'git/isomorphic-git@1.19.3',
6988
6995
  };
6989
6996
 
6990
6997
  class FIFO {
@@ -11812,6 +11819,7 @@ async function _push({
11812
11819
  }
11813
11820
  }
11814
11821
 
11822
+ if (oid === oldoid) force = true;
11815
11823
  if (!force) {
11816
11824
  // Is it a tag that already exists?
11817
11825
  if (
@@ -14031,12 +14039,14 @@ function version() {
14031
14039
  *
14032
14040
  * Example 2: Return the difference between the working directory and the HEAD commit
14033
14041
  * ```js
14034
- * const diff = require('diff-lines')
14035
- * async function map(filepath, [head, workdir]) {
14042
+ * const map = async (filepath, [head, workdir]) => {
14036
14043
  * return {
14037
14044
  * filepath,
14038
- * oid: await head.oid(),
14039
- * 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
+ * )
14040
14050
  * }
14041
14051
  * }
14042
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
@@ -2706,7 +2706,7 @@ class GitPackIndex {
2706
2706
  const objectsByDepth = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
2707
2707
  for (let offset in offsetToObject) {
2708
2708
  offset = Number(offset);
2709
- const percent = Math.floor((count++ * 100) / totalObjectCount);
2709
+ const percent = Math.floor((count * 100) / totalObjectCount);
2710
2710
  if (percent !== lastPercent) {
2711
2711
  if (onProgress) {
2712
2712
  await onProgress({
@@ -2716,6 +2716,7 @@ class GitPackIndex {
2716
2716
  });
2717
2717
  }
2718
2718
  }
2719
+ count++;
2719
2720
  lastPercent = percent;
2720
2721
 
2721
2722
  const o = offsetToObject[offset];
@@ -3912,7 +3913,7 @@ class GitWalkerRepo {
3912
3913
  * @param {string} [args.ref='HEAD']
3913
3914
  * @returns {Walker}
3914
3915
  */
3915
- function TREE({ ref = 'HEAD' }) {
3916
+ function TREE({ ref = 'HEAD' } = {}) {
3916
3917
  const o = Object.create(null);
3917
3918
  Object.defineProperty(o, GitWalkSymbol, {
3918
3919
  value: function({ fs, gitdir, cache }) {
@@ -4482,6 +4483,12 @@ function assertParameter(name, value) {
4482
4483
  }
4483
4484
  }
4484
4485
 
4486
+ function posixifyPathBuffer(buffer) {
4487
+ let idx;
4488
+ while (~(idx = buffer.indexOf(92))) buffer[idx] = 47;
4489
+ return buffer
4490
+ }
4491
+
4485
4492
  // @ts-check
4486
4493
 
4487
4494
  /**
@@ -4558,7 +4565,7 @@ async function addToIndex({ dir, gitdir, fs, filepath, index, force }) {
4558
4565
  await Promise.all(promises);
4559
4566
  } else {
4560
4567
  const object = stats.isSymbolicLink()
4561
- ? await fs.readlink(join(dir, currentFilepath))
4568
+ ? await fs.readlink(join(dir, currentFilepath)).then(posixifyPathBuffer)
4562
4569
  : await fs.read(join(dir, currentFilepath));
4563
4570
  if (object === null) throw new NotFoundError(currentFilepath)
4564
4571
  const oid = await _writeObject({ fs, gitdir, type: 'blob', object });
@@ -6977,8 +6984,8 @@ function filterCapabilities(server, client) {
6977
6984
 
6978
6985
  const pkg = {
6979
6986
  name: 'isomorphic-git',
6980
- version: '1.19.0',
6981
- agent: 'git/isomorphic-git@1.19.0',
6987
+ version: '1.19.3',
6988
+ agent: 'git/isomorphic-git@1.19.3',
6982
6989
  };
6983
6990
 
6984
6991
  class FIFO {
@@ -11806,6 +11813,7 @@ async function _push({
11806
11813
  }
11807
11814
  }
11808
11815
 
11816
+ if (oid === oldoid) force = true;
11809
11817
  if (!force) {
11810
11818
  // Is it a tag that already exists?
11811
11819
  if (
@@ -14025,12 +14033,14 @@ function version() {
14025
14033
  *
14026
14034
  * Example 2: Return the difference between the working directory and the HEAD commit
14027
14035
  * ```js
14028
- * const diff = require('diff-lines')
14029
- * async function map(filepath, [head, workdir]) {
14036
+ * const map = async (filepath, [head, workdir]) => {
14030
14037
  * return {
14031
14038
  * filepath,
14032
- * oid: await head.oid(),
14033
- * 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
+ * )
14034
14044
  * }
14035
14045
  * }
14036
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
  * ```