Skip to content

statusMatrix() does not work correctly when there is a symlink that targets an ignored directory #1215

Closed

Description

@KSXGitHub

Bug description

When there is a symlink that targets an ignored directory (such as node_modules), statusMatrix() would list files within the ignored directory as "new". This is different from git status --porcelain=v1 when these files are not listed.

Steps to reproduce

  1. Clone https://github.com/KSXGitHub/isomorphic-git-issue-incorrect-file-listing-for-symlink.git
  2. Run npm install and npm test

You will see that the files "within" symlink-to-ignored-directory are listed by isomorphic-git but not by native git.

Activity

  1. minutechreview commented on Jul 20, 2026

    @minutechreview
    Contributor

    Hi! I'd love to take a look at this issue and contribute a fix.

    From reading through the description, my understanding is that statusMatrix() currently follows symlinks even when those symlinks point to directories that are in .gitignore. Native git status correctly ignores such symlinks, so isomorphic-git should match that behavior.

    My plan:

    1. Reproduce the issue using the linked test repo
    2. Trace the statusMatrix() file walking logic to find where symlink targets are being followed without checking .gitignore
    3. Add a check to resolve symlink targets and skip them if the resolved path falls under an ignored directory
    4. Add a regression test to confirm the fix

    Could someone please assign this to me or confirm it's still available? Thanks!

  2. jcubic commented on Jul 20, 2026

    @jcubic
    Member

    @minutechreview this project doesn't use assignments. You can work on this issue, but remember to add unit tests.

  3. jcubic commented on Jul 21, 2026

    @jcubic
    Member

    🎉 This issue has been resolved in version 1.38.10 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions