Fix grouping wiki pages by directory

What does this MR do?

If a page has the same name as a directory the WikiPage#group_by_directory method tries to group pages into WikiPage. This MR ensures, that pages are grouped into WikiDirectory

Related issue

https://gitlab.com/gitlab-org/gitlab-ce/issues/60431

Merge request reports

Loading