isomorphic-git 1.42.3 → 1.42.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/index.cjs CHANGED
@@ -5755,14 +5755,17 @@ class GitIgnoreManager {
5755
5755
  });
5756
5756
  }
5757
5757
  let ignoredStatus = false;
5758
- for (const p of pairs) {
5758
+ for (const [index, p] of pairs.entries()) {
5759
5759
  let file;
5760
5760
  try {
5761
5761
  file = await fs.read(p.gitignore, 'utf8');
5762
5762
  } catch (err) {
5763
5763
  if (err.code === 'NOENT') continue
5764
5764
  }
5765
- const ign = ignore().add(excludes);
5765
+ const ign = ignore();
5766
+ // The patterns in .git/info/exclude are relative to the working directory,
5767
+ // so only the first pair, which holds the full filepath, can use them.
5768
+ if (index === 0) ign.add(excludes);
5766
5769
  ign.add(file);
5767
5770
  // If the parent directory is excluded, we are done.
5768
5771
  // "It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined."
@@ -9803,8 +9806,8 @@ function filterCapabilities(server, client) {
9803
9806
 
9804
9807
  const pkg = {
9805
9808
  name: 'isomorphic-git',
9806
- version: '1.42.3',
9807
- agent: 'git/isomorphic-git@1.42.3',
9809
+ version: '1.42.4',
9810
+ agent: 'git/isomorphic-git@1.42.4',
9808
9811
  };
9809
9812
 
9810
9813
  class FIFO {
package/index.js CHANGED
@@ -5742,14 +5742,17 @@ class GitIgnoreManager {
5742
5742
  });
5743
5743
  }
5744
5744
  let ignoredStatus = false;
5745
- for (const p of pairs) {
5745
+ for (const [index, p] of pairs.entries()) {
5746
5746
  let file;
5747
5747
  try {
5748
5748
  file = await fs.read(p.gitignore, 'utf8');
5749
5749
  } catch (err) {
5750
5750
  if (err.code === 'NOENT') continue
5751
5751
  }
5752
- const ign = ignore().add(excludes);
5752
+ const ign = ignore();
5753
+ // The patterns in .git/info/exclude are relative to the working directory,
5754
+ // so only the first pair, which holds the full filepath, can use them.
5755
+ if (index === 0) ign.add(excludes);
5753
5756
  ign.add(file);
5754
5757
  // If the parent directory is excluded, we are done.
5755
5758
  // "It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined."
@@ -9790,8 +9793,8 @@ function filterCapabilities(server, client) {
9790
9793
 
9791
9794
  const pkg = {
9792
9795
  name: 'isomorphic-git',
9793
- version: '1.42.3',
9794
- agent: 'git/isomorphic-git@1.42.3',
9796
+ version: '1.42.4',
9797
+ agent: 'git/isomorphic-git@1.42.4',
9795
9798
  };
9796
9799
 
9797
9800
  class FIFO {