(#21659) Links are seen as files and get bucketed.

Links are seen as files and get bucketed. The code that checks the filetype uses File.stat(file).type. This for some reason returns that it is a file:

    irb(main):001:0> File.stat(‘wellthisisembarrasing’).ftype
    => “file”

File.lstat(file).ftype return the correct value:

    irb(main):002:0> File.lstat(‘wellthisisembarrasing’).ftype
    => “link”

This patch fixes this.