isomorphic-git 1.36.0 → 1.36.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.
package/README.md CHANGED
@@ -248,6 +248,8 @@ npm install
248
248
  npm test
249
249
  ```
250
250
 
251
+ The new release happens automatically after every PR merge. We use [semantic release](https://github.com/semantic-release/semantic-release).
252
+
251
253
  Check out the [`CONTRIBUTING`](./CONTRIBUTING.md) document for more instructions.
252
254
 
253
255
  ## Who is using isomorphic-git?
@@ -408,6 +410,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
408
410
  <td align="center"><a href="https://github.com/anish3333"><img src="https://avatars.githubusercontent.com/u/128889867?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Anish Awasthi</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=anish3333" title="Code">💻</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=anish3333" title="Documentation">📖</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=anish3333" title="Tests">⚠️</a></td>
409
411
  <td align="center"><a href="https://github.com/fetsorn"><img src="https://avatars.githubusercontent.com/u/12858105?v=4?s=60" width="60px;" alt=""/><br /><sub><b>fetsorn</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=fetsorn" title="Documentation">📖</a></td>
410
412
  <td align="center"><a href="http://www.dreamingcat.me/"><img src="https://avatars.githubusercontent.com/u/7752883?v=4?s=60" width="60px;" alt=""/><br /><sub><b>xiaoboost</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=xiaoboost" title="Code">💻</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=xiaoboost" title="Documentation">📖</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=xiaoboost" title="Tests">⚠️</a></td>
413
+ <td align="center"><a href="https://github.com/Andarist"><img src="https://avatars.githubusercontent.com/u/9800850?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Mateusz Burzyński</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=Andarist" title="Code">💻</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=Andarist" title="Tests">⚠️</a></td>
411
414
  </tr>
412
415
  </table>
413
416
 
package/index.cjs CHANGED
@@ -4513,9 +4513,14 @@ class GitWalkerFs {
4513
4513
  if ((await entry.type()) === 'tree') {
4514
4514
  entry._content = undefined;
4515
4515
  } else {
4516
- const config = await this._getGitConfig(fs, gitdir);
4517
- const autocrlf = await config.get('core.autocrlf');
4518
- const content = await fs.read(`${dir}/${entry._fullpath}`, { autocrlf });
4516
+ let content;
4517
+ if ((await entry.mode()) >> 12 === 0b1010) {
4518
+ content = await fs.readlink(`${dir}/${entry._fullpath}`);
4519
+ } else {
4520
+ const config = await this._getGitConfig(fs, gitdir);
4521
+ const autocrlf = await config.get('core.autocrlf');
4522
+ content = await fs.read(`${dir}/${entry._fullpath}`, { autocrlf });
4523
+ }
4519
4524
  // workaround for a BrowserFS edge case
4520
4525
  entry._actualSize = content.length;
4521
4526
  if (entry._stat && entry._stat.size === -1) {
@@ -4829,8 +4834,8 @@ function isPromiseFs(fs) {
4829
4834
 
4830
4835
  // List of commands all filesystems are expected to provide. `rm` is not
4831
4836
  // included since it may not exist and must be handled as a special case
4837
+ // Likewise with `cp`.
4832
4838
  const commands = [
4833
- 'cp',
4834
4839
  'readFile',
4835
4840
  'writeFile',
4836
4841
  'mkdir',
@@ -4854,12 +4859,14 @@ function bindFs(target, fs) {
4854
4859
  }
4855
4860
  }
4856
4861
 
4857
- // Handle the special case of `rm`
4862
+ // Handle the special cases of `rm` and `cp`
4858
4863
  if (isPromiseFs(fs)) {
4864
+ if (fs.cp) target._cp = fs.cp.bind(fs);
4859
4865
  if (fs.rm) target._rm = fs.rm.bind(fs);
4860
4866
  else if (fs.rmdir.length > 1) target._rm = fs.rmdir.bind(fs);
4861
4867
  else target._rm = rmRecursive.bind(null, target);
4862
4868
  } else {
4869
+ if (fs.cp) target._cp = pify(fs.cp.bind(fs));
4863
4870
  if (fs.rm) target._rm = pify(fs.rm.bind(fs));
4864
4871
  else if (fs.rmdir.length > 2) target._rm = pify(fs.rmdir.bind(fs));
4865
4872
  else target._rm = rmRecursive.bind(null, target);
@@ -8254,8 +8261,8 @@ function filterCapabilities(server, client) {
8254
8261
 
8255
8262
  const pkg = {
8256
8263
  name: 'isomorphic-git',
8257
- version: '1.36.0',
8258
- agent: 'git/isomorphic-git@1.36.0',
8264
+ version: '1.36.2',
8265
+ agent: 'git/isomorphic-git@1.36.2',
8259
8266
  };
8260
8267
 
8261
8268
  class FIFO {
package/index.js CHANGED
@@ -4507,9 +4507,14 @@ class GitWalkerFs {
4507
4507
  if ((await entry.type()) === 'tree') {
4508
4508
  entry._content = undefined;
4509
4509
  } else {
4510
- const config = await this._getGitConfig(fs, gitdir);
4511
- const autocrlf = await config.get('core.autocrlf');
4512
- const content = await fs.read(`${dir}/${entry._fullpath}`, { autocrlf });
4510
+ let content;
4511
+ if ((await entry.mode()) >> 12 === 0b1010) {
4512
+ content = await fs.readlink(`${dir}/${entry._fullpath}`);
4513
+ } else {
4514
+ const config = await this._getGitConfig(fs, gitdir);
4515
+ const autocrlf = await config.get('core.autocrlf');
4516
+ content = await fs.read(`${dir}/${entry._fullpath}`, { autocrlf });
4517
+ }
4513
4518
  // workaround for a BrowserFS edge case
4514
4519
  entry._actualSize = content.length;
4515
4520
  if (entry._stat && entry._stat.size === -1) {
@@ -4823,8 +4828,8 @@ function isPromiseFs(fs) {
4823
4828
 
4824
4829
  // List of commands all filesystems are expected to provide. `rm` is not
4825
4830
  // included since it may not exist and must be handled as a special case
4831
+ // Likewise with `cp`.
4826
4832
  const commands = [
4827
- 'cp',
4828
4833
  'readFile',
4829
4834
  'writeFile',
4830
4835
  'mkdir',
@@ -4848,12 +4853,14 @@ function bindFs(target, fs) {
4848
4853
  }
4849
4854
  }
4850
4855
 
4851
- // Handle the special case of `rm`
4856
+ // Handle the special cases of `rm` and `cp`
4852
4857
  if (isPromiseFs(fs)) {
4858
+ if (fs.cp) target._cp = fs.cp.bind(fs);
4853
4859
  if (fs.rm) target._rm = fs.rm.bind(fs);
4854
4860
  else if (fs.rmdir.length > 1) target._rm = fs.rmdir.bind(fs);
4855
4861
  else target._rm = rmRecursive.bind(null, target);
4856
4862
  } else {
4863
+ if (fs.cp) target._cp = pify(fs.cp.bind(fs));
4857
4864
  if (fs.rm) target._rm = pify(fs.rm.bind(fs));
4858
4865
  else if (fs.rmdir.length > 2) target._rm = pify(fs.rmdir.bind(fs));
4859
4866
  else target._rm = rmRecursive.bind(null, target);
@@ -8248,8 +8255,8 @@ function filterCapabilities(server, client) {
8248
8255
 
8249
8256
  const pkg = {
8250
8257
  name: 'isomorphic-git',
8251
- version: '1.36.0',
8252
- agent: 'git/isomorphic-git@1.36.0',
8258
+ version: '1.36.2',
8259
+ agent: 'git/isomorphic-git@1.36.2',
8253
8260
  };
8254
8261
 
8255
8262
  class FIFO {