-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Do not traverse symlinks in heuristics #3946
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me
def symlink? | ||
return @symlink if !@symlink.nil? | ||
@symlink = (File.symlink?(@fullpath) rescue false) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kivikakk I just noticed this is reporting a bunch of warnings in the tests: https://travis-ci.org/github/linguist/jobs/323823193
/home/travis/build/github/linguist/lib/linguist/file_blob.rb:30: warning: instance variable @symlink not initialized
/home/travis/build/github/linguist/lib/linguist/file_blob.rb:30: warning: instance variable @symlink not initialized
/home/travis/build/github/linguist/lib/linguist/file_blob.rb:30: warning: instance variable @symlink not initialized
/home/travis/build/github/linguist/lib/linguist/file_blob.rb:30: warning: instance variable @symlink not initialized
They're not failures hence we missed this before, but I think it'd be best to clean these up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've also just realised this PR didn't intro any tests to verify the symlink behaviour. Sorry I missed this before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also a test in 3eabf45.
This is part of what should be a correct fix for github/markup#1133. Changes are required in
markup
itself and dotcom to pass the symlink info through from the repository.