Fix symlinks to dirs

Just got broken because of removing trailing slash.

Thanks to filterfalse.
Simplify code in clone_files()

Names of directories don't have trailing slash anymore.
Merge branch 'fix-slash-workaround'

Fix sorting and local-filtering of symlinks to directories.

Just got broken because of removing trailing slash.

Thanks to filterfalse.