Consider the following pipeline code:
All the listed directories listed in "keep" are preserved (as both the directories themselves, as well as all parents are explicitly excluded!) and the included files are preserved.
Only the files created outside of directories listed in "keep" are expected to be removed.
Only the directories + paths "foo/expected" and "foo2/expected" are preserved.
All the directories with a nested paths, relative to include pattern, are impossible to preserve.
It appears as if excludes fail to apply to any directory, if the directory was matched using a non-empty
part of the INCLUDE wildcard. Directories only matched by a single star, or an empty double-star have their EXCLUDE rules evaluated correctly.
For files, excludes are properly evaluated even if the INCLUDE was matching with a non-empty double-star.
E.g. with "deleteDirs: false", all expected files are protected correctly.