Mergerequest modified files are ordered differently in the tree view than in the change list
### Summary
Mergerequest modified files are ordered differently in the tree view than in the change list.
### Steps to reproduce
Create a mergerequest with changes on paths like `foo-bar/file` and `foo/bar/file`.
### Example Project
https://gitlab.com/sim6/gitlab-issue-sort-mergerequest-changes/-/merge_requests/1/diffs
See also https://gitlab.com/isard/isardvdi/-/merge_requests/514/diffs
### What is the current *bug* behavior?
Mergerequest modified files are ordered differently in the tree view than in the change list.
### What is the expected *correct* behavior?
Mergerequest modified files tree view and change list should use the same criteria to order the files.
### Relevant logs and/or screenshots


### Output of checks
This bug happens on GitLab.com
issue