-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle symlinks correctly #18
Comments
ok - time to write some tests ;-) |
Thanks, that's very kind that you are willing to look into this. Let me know if you need any help with this. |
I am encountering this issue as well but have a slightly different use case to the one described. For my Python projects, I use poetry to manage virtual environments. I have When adding rules to The results of this looks as I would expect except it contains 3 files within the My current workaround is to add an additional rule ( If no one else has time to look into fixing this, I'll circle back to see what I can work out. |
ok, I will look into it - but will take some time.... |
This is a follow up to issue #16. The glob issue is now resolved, however, there are still problems that I encountered.
pathlib.Path().resolve()
follows symlinksThe match() method
resolve()
s the target before matching it against the ignore rules. That means that you may not be able to match against a file under a symlinked directory. Consider the following example:where
catch_me
is a symlink toprey
. Thegitignore
contains the following:Now,
match('catch_me')
will fail as it is resolved toprey
first before matching against the rule happens. A solution would be to avoid the resolving, for example:In version 3 and later, globmatch does not follow symlinks unless the
FOLLOW
flag is set, e.g.I believe the follow flag should be included.
The text was updated successfully, but these errors were encountered: