Please note that directory patterns ending with a slash some/directory/ matches the content of the directory, but not the directory itself. If you want the pattern to match the directory and its content, make sure it does not have a / at the end of the pattern.
It matches the things under the directory, by way of being a prefix of those paths.
That said, it might make sense to have it match like imsodin suggested it should. We know at every instance whether the thing we are looking at is a directory, and could make it match a directory/ pattern. There is already another way to express “all sub-things of a directory but not the directory itself” (directory/**) so we wouldn’t lose that possibility, just gain the capability to say “match a directory name like this and any children”.