Allow exclude to match also subdir paths

When recursively traversing directories, it
is useful to be also exclude subdirectory trees,
for example --exclude=a/tests should exclude a/tests
but not b/tests.