isomorphic-git 1.10.0 → 1.10.4

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
@@ -338,6 +338,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
338
338
  <td align="center"><a href="https://ryotak.me/"><img src="https://avatars.githubusercontent.com/u/49341894?v=4?s=60" width="60px;" alt=""/><br /><sub><b>RyotaK</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/issues?q=author%3ARy0taK" title="Bug reports">🐛</a></td>
339
339
  <td align="center"><a href="https://github.com/strangedev"><img src="https://avatars.githubusercontent.com/u/3045979?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Noah Hummel</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=strangedev" title="Code">💻</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=strangedev" title="Tests">⚠️</a></td>
340
340
  <td align="center"><a href="https://github.com/mtlewis"><img src="https://avatars.githubusercontent.com/u/542836?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Mike Lewis</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=mtlewis" title="Documentation">📖</a></td>
341
+ <td align="center"><a href="https://twitter.com/SamVerschueren"><img src="https://avatars.githubusercontent.com/u/1913805?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Sam Verschueren</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=SamVerschueren" title="Code">💻</a></td>
341
342
  </tr>
342
343
  </table>
343
344
 
@@ -1,8 +1,8 @@
1
1
  [
2
2
  "HeadlessChrome 0.0.0 (Linux 0.0.0)",
3
- "Firefox 91.0.0 (Ubuntu 0.0.0)",
4
- "Chrome Mobile 91.0.4472 (Android 0.0.0)",
3
+ "Firefox 95.0.0 (Ubuntu 0.0.0)",
5
4
  "Chrome 79.0.3945 (Windows 10 0.0.0)",
5
+ "Chrome Mobile 94.0.4606 (Android 0.0.0)",
6
6
  "Safari 13.1.0 (Mac OS X 10.15.4)",
7
7
  "Mobile Safari 13.0.0 (iOS 13.0.0)"
8
8
  ]
package/index.cjs CHANGED
@@ -1694,8 +1694,8 @@ class GitRefManager {
1694
1694
  if (serverRef.startsWith('refs/tags') && !serverRef.endsWith('^{}')) {
1695
1695
  // Git's behavior is to only fetch tags that do not conflict with tags already present.
1696
1696
  if (!(await GitRefManager.exists({ fs, gitdir, ref: serverRef }))) {
1697
- // If there is a dereferenced an annotated tag value available, prefer that.
1698
- const oid = refs.get(serverRef + '^{}') || refs.get(serverRef);
1697
+ // Always use the object id of the tag itself, and not the peeled object id.
1698
+ const oid = refs.get(serverRef);
1699
1699
  actualRefsToWrite.set(serverRef, oid);
1700
1700
  }
1701
1701
  }
@@ -3976,7 +3976,15 @@ class GitWalkerFs {
3976
3976
  oid = await shasum(
3977
3977
  GitObject.wrap({ type: 'blob', object: await entry.content() })
3978
3978
  );
3979
- if (stage && oid === stage.oid) {
3979
+ // Update the stats in the index so we will get a "cache hit" next time
3980
+ // 1) if we can (because the oid and mode are the same)
3981
+ // 2) and only if we need to (because other stats differ)
3982
+ if (
3983
+ stage &&
3984
+ oid === stage.oid &&
3985
+ stats.mode === stage.mode &&
3986
+ compareStats(stats, stage)
3987
+ ) {
3980
3988
  index.insert({
3981
3989
  filepath: entry._fullpath,
3982
3990
  stats,
@@ -4034,7 +4042,7 @@ class GitIgnoreManager {
4034
4042
  filepath,
4035
4043
  },
4036
4044
  ];
4037
- const pieces = filepath.split('/');
4045
+ const pieces = filepath.split('/').filter(Boolean);
4038
4046
  for (let i = 1; i < pieces.length; i++) {
4039
4047
  const folder = pieces.slice(0, i).join('/');
4040
4048
  const file = pieces.slice(i).join('/');
@@ -6425,7 +6433,14 @@ async function parseRefsAdResponse(stream, { service }) {
6425
6433
  let lineOne = await read();
6426
6434
  // skip past any flushes
6427
6435
  while (lineOne === null) lineOne = await read();
6436
+
6428
6437
  if (lineOne === true) throw new EmptyServerResponseError()
6438
+
6439
+ // Handle protocol v2 responses (Bitbucket Server doesn't include a `# service=` line)
6440
+ if (lineOne.includes('version 2')) {
6441
+ return parseCapabilitiesV2(read)
6442
+ }
6443
+
6429
6444
  // Clients MUST ignore an LF at the end of the line.
6430
6445
  if (lineOne.toString('utf8').replace(/\n$/, '') !== `# service=${service}`) {
6431
6446
  throw new ParseError(`# service=${service}\\n`, lineOne.toString('utf8'))
@@ -6437,10 +6452,12 @@ async function parseRefsAdResponse(stream, { service }) {
6437
6452
  // are returned.
6438
6453
  if (lineTwo === true) return { capabilities, refs, symrefs }
6439
6454
  lineTwo = lineTwo.toString('utf8');
6455
+
6440
6456
  // Handle protocol v2 responses
6441
6457
  if (lineTwo.includes('version 2')) {
6442
6458
  return parseCapabilitiesV2(read)
6443
6459
  }
6460
+
6444
6461
  const [firstRef, capabilitiesLine] = splitAndAssert(lineTwo, '\x00', '\\x00');
6445
6462
  capabilitiesLine.split(' ').map(x => capabilities.add(x));
6446
6463
  const [ref, name] = splitAndAssert(firstRef, ' ', ' ');
@@ -6848,8 +6865,8 @@ function filterCapabilities(server, client) {
6848
6865
 
6849
6866
  const pkg = {
6850
6867
  name: 'isomorphic-git',
6851
- version: '1.10.0',
6852
- agent: 'git/isomorphic-git@1.10.0',
6868
+ version: '1.10.4',
6869
+ agent: 'git/isomorphic-git@1.10.4',
6853
6870
  };
6854
6871
 
6855
6872
  class FIFO {
package/index.js CHANGED
@@ -1688,8 +1688,8 @@ class GitRefManager {
1688
1688
  if (serverRef.startsWith('refs/tags') && !serverRef.endsWith('^{}')) {
1689
1689
  // Git's behavior is to only fetch tags that do not conflict with tags already present.
1690
1690
  if (!(await GitRefManager.exists({ fs, gitdir, ref: serverRef }))) {
1691
- // If there is a dereferenced an annotated tag value available, prefer that.
1692
- const oid = refs.get(serverRef + '^{}') || refs.get(serverRef);
1691
+ // Always use the object id of the tag itself, and not the peeled object id.
1692
+ const oid = refs.get(serverRef);
1693
1693
  actualRefsToWrite.set(serverRef, oid);
1694
1694
  }
1695
1695
  }
@@ -3970,7 +3970,15 @@ class GitWalkerFs {
3970
3970
  oid = await shasum(
3971
3971
  GitObject.wrap({ type: 'blob', object: await entry.content() })
3972
3972
  );
3973
- if (stage && oid === stage.oid) {
3973
+ // Update the stats in the index so we will get a "cache hit" next time
3974
+ // 1) if we can (because the oid and mode are the same)
3975
+ // 2) and only if we need to (because other stats differ)
3976
+ if (
3977
+ stage &&
3978
+ oid === stage.oid &&
3979
+ stats.mode === stage.mode &&
3980
+ compareStats(stats, stage)
3981
+ ) {
3974
3982
  index.insert({
3975
3983
  filepath: entry._fullpath,
3976
3984
  stats,
@@ -4028,7 +4036,7 @@ class GitIgnoreManager {
4028
4036
  filepath,
4029
4037
  },
4030
4038
  ];
4031
- const pieces = filepath.split('/');
4039
+ const pieces = filepath.split('/').filter(Boolean);
4032
4040
  for (let i = 1; i < pieces.length; i++) {
4033
4041
  const folder = pieces.slice(0, i).join('/');
4034
4042
  const file = pieces.slice(i).join('/');
@@ -6419,7 +6427,14 @@ async function parseRefsAdResponse(stream, { service }) {
6419
6427
  let lineOne = await read();
6420
6428
  // skip past any flushes
6421
6429
  while (lineOne === null) lineOne = await read();
6430
+
6422
6431
  if (lineOne === true) throw new EmptyServerResponseError()
6432
+
6433
+ // Handle protocol v2 responses (Bitbucket Server doesn't include a `# service=` line)
6434
+ if (lineOne.includes('version 2')) {
6435
+ return parseCapabilitiesV2(read)
6436
+ }
6437
+
6423
6438
  // Clients MUST ignore an LF at the end of the line.
6424
6439
  if (lineOne.toString('utf8').replace(/\n$/, '') !== `# service=${service}`) {
6425
6440
  throw new ParseError(`# service=${service}\\n`, lineOne.toString('utf8'))
@@ -6431,10 +6446,12 @@ async function parseRefsAdResponse(stream, { service }) {
6431
6446
  // are returned.
6432
6447
  if (lineTwo === true) return { capabilities, refs, symrefs }
6433
6448
  lineTwo = lineTwo.toString('utf8');
6449
+
6434
6450
  // Handle protocol v2 responses
6435
6451
  if (lineTwo.includes('version 2')) {
6436
6452
  return parseCapabilitiesV2(read)
6437
6453
  }
6454
+
6438
6455
  const [firstRef, capabilitiesLine] = splitAndAssert(lineTwo, '\x00', '\\x00');
6439
6456
  capabilitiesLine.split(' ').map(x => capabilities.add(x));
6440
6457
  const [ref, name] = splitAndAssert(firstRef, ' ', ' ');
@@ -6842,8 +6859,8 @@ function filterCapabilities(server, client) {
6842
6859
 
6843
6860
  const pkg = {
6844
6861
  name: 'isomorphic-git',
6845
- version: '1.10.0',
6846
- agent: 'git/isomorphic-git@1.10.0',
6862
+ version: '1.10.4',
6863
+ agent: 'git/isomorphic-git@1.10.4',
6847
6864
  };
6848
6865
 
6849
6866
  class FIFO {