isomorphic-git 1.25.2 → 1.25.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
@@ -365,6 +365,8 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
365
365
  </tr>
366
366
  <tr>
367
367
  <td align="center"><a href="https://github.com/DanilKazanov"><img src="https://avatars.githubusercontent.com/u/139755256?v=4?s=60" width="60px;" alt=""/><br /><sub><b>DanilKazanov</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=DanilKazanov" title="Code">💻</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=DanilKazanov" title="Documentation">📖</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=DanilKazanov" title="Tests">⚠️</a></td>
368
+ <td align="center"><a href="https://api.github.com/users/hisco"><img src="https://avatars.githubusercontent.com/u/39222286?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Eyal Hisco</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/issues?q=author%3Ahisco" title="Bug reports">🐛</a></td>
369
+ <td align="center"><a href="https://github.com/scolladon"><img src="https://avatars.githubusercontent.com/u/522422?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Sebastien</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=scolladon" title="Code">💻</a></td>
368
370
  </tr>
369
371
  </table>
370
372
 
@@ -3,8 +3,10 @@
3
3
  "Firefox 121.0 (Ubuntu 0.0.0)",
4
4
  "X Chrome 117.0.0.0 (Android 10)",
5
5
  "Edge 79.0.309.65 (Windows 10)",
6
- "Safari 13.1 (Mac OS 10.15.4)",
7
6
  "Mobile Safari 13.0 (iOS 13.0)",
7
+ "Safari 13.1 (Mac OS 10.15.4)",
8
+ "Chrome Headless 79.0.3945.0 (Linux x86_64)",
9
+ "X Chrome 117.0.0.0 (Android 10)",
8
10
  "Chrome Headless 79.0.3945.0 (Linux x86_64)",
9
11
  "Chrome 117.0.0.0 (Android 10)"
10
12
  ]
package/index.cjs CHANGED
@@ -1448,16 +1448,32 @@ function compareRefNames(a, b) {
1448
1448
  return tmp
1449
1449
  }
1450
1450
 
1451
+ const memo = new Map();
1451
1452
  function normalizePath(path) {
1453
+ let normalizedPath = memo.get(path);
1454
+ if (!normalizedPath) {
1455
+ normalizedPath = normalizePathInternal(path);
1456
+ memo.set(path, normalizedPath);
1457
+ }
1458
+ return normalizedPath
1459
+ }
1460
+
1461
+ function normalizePathInternal(path) {
1462
+ path = path
1463
+ .split('/./')
1464
+ .join('/') // Replace '/./' with '/'
1465
+ .replace(/\/{2,}/g, '/'); // Replace consecutive '/'
1466
+
1467
+ if (path === '/.') return '/' // if path === '/.' return '/'
1468
+ if (path === './') return '.' // if path === './' return '.'
1469
+
1470
+ if (path.startsWith('./')) path = path.slice(2); // Remove leading './'
1471
+ if (path.endsWith('/.')) path = path.slice(0, -2); // Remove trailing '/.'
1472
+ if (path.length > 1 && path.endsWith('/')) path = path.slice(0, -1); // Remove trailing '/'
1473
+
1474
+ if (path === '') return '.' // if path === '' return '.'
1475
+
1452
1476
  return path
1453
- .replace(/\/\.\//g, '/') // Replace '/./' with '/'
1454
- .replace(/\/{2,}/g, '/') // Replace consecutive '/'
1455
- .replace(/^\/\.$/, '/') // if path === '/.' return '/'
1456
- .replace(/^\.\/$/, '.') // if path === './' return '.'
1457
- .replace(/^\.\//, '') // Remove leading './'
1458
- .replace(/\/\.$/, '') // Remove trailing '/.'
1459
- .replace(/(.+)\/$/, '$1') // Remove trailing '/'
1460
- .replace(/^$/, '.') // if path === '' return '.'
1461
1477
  }
1462
1478
 
1463
1479
  // For some reason path.posix.join is undefined in webpack
@@ -7317,8 +7333,8 @@ function filterCapabilities(server, client) {
7317
7333
 
7318
7334
  const pkg = {
7319
7335
  name: 'isomorphic-git',
7320
- version: '1.25.2',
7321
- agent: 'git/isomorphic-git@1.25.2',
7336
+ version: '1.25.3',
7337
+ agent: 'git/isomorphic-git@1.25.3',
7322
7338
  };
7323
7339
 
7324
7340
  class FIFO {
package/index.js CHANGED
@@ -1442,16 +1442,32 @@ function compareRefNames(a, b) {
1442
1442
  return tmp
1443
1443
  }
1444
1444
 
1445
+ const memo = new Map();
1445
1446
  function normalizePath(path) {
1447
+ let normalizedPath = memo.get(path);
1448
+ if (!normalizedPath) {
1449
+ normalizedPath = normalizePathInternal(path);
1450
+ memo.set(path, normalizedPath);
1451
+ }
1452
+ return normalizedPath
1453
+ }
1454
+
1455
+ function normalizePathInternal(path) {
1456
+ path = path
1457
+ .split('/./')
1458
+ .join('/') // Replace '/./' with '/'
1459
+ .replace(/\/{2,}/g, '/'); // Replace consecutive '/'
1460
+
1461
+ if (path === '/.') return '/' // if path === '/.' return '/'
1462
+ if (path === './') return '.' // if path === './' return '.'
1463
+
1464
+ if (path.startsWith('./')) path = path.slice(2); // Remove leading './'
1465
+ if (path.endsWith('/.')) path = path.slice(0, -2); // Remove trailing '/.'
1466
+ if (path.length > 1 && path.endsWith('/')) path = path.slice(0, -1); // Remove trailing '/'
1467
+
1468
+ if (path === '') return '.' // if path === '' return '.'
1469
+
1446
1470
  return path
1447
- .replace(/\/\.\//g, '/') // Replace '/./' with '/'
1448
- .replace(/\/{2,}/g, '/') // Replace consecutive '/'
1449
- .replace(/^\/\.$/, '/') // if path === '/.' return '/'
1450
- .replace(/^\.\/$/, '.') // if path === './' return '.'
1451
- .replace(/^\.\//, '') // Remove leading './'
1452
- .replace(/\/\.$/, '') // Remove trailing '/.'
1453
- .replace(/(.+)\/$/, '$1') // Remove trailing '/'
1454
- .replace(/^$/, '.') // if path === '' return '.'
1455
1471
  }
1456
1472
 
1457
1473
  // For some reason path.posix.join is undefined in webpack
@@ -7311,8 +7327,8 @@ function filterCapabilities(server, client) {
7311
7327
 
7312
7328
  const pkg = {
7313
7329
  name: 'isomorphic-git',
7314
- version: '1.25.2',
7315
- agent: 'git/isomorphic-git@1.25.2',
7330
+ version: '1.25.3',
7331
+ agent: 'git/isomorphic-git@1.25.3',
7316
7332
  };
7317
7333
 
7318
7334
  class FIFO {