Links are seen as files and get bucketed. Fixes #21659.

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.ftype(file) return the correct value:

  irb(main):002:0> File.ftype(‘wellthisisembarrasing’) => “link”