Skip to content

from-disk-exclude: handle top_path with a final slash

Pierre-Yves David requested to merge marmoute/swh-model:fix-exclude into master

Before this patch giving from_disk and directory path with final '/'s would confuses the exclusion code as it would assume it need to exclude one extra character to get the basename. This would swallow the first char of the directory to exclude, leading to a righful crash.

This would affect directory excluded in the first directory only as sub directory would be called withou a '/'.

We fix the path at the top of the function as trailing '/'s could confuse other code too in the future.

Merge request reports