Merge request file order inconsistent with sidebar listview

Summary

In the diff, the files are ordered such that the least nested files will be shown first, followed by files in folder. In contrast, the navigation sidebar orders the nested folder first, then the files in the top folder.

Steps to reproduce

Make a merge request with example files as below, observe.

What is the current bug behavior?

In a merge request with 2 files: src/file.h file2.h

the sidebar will order them as src

  • file.h file2.h

while in the diff the order will be

file2.h src/file.h

This is somewhat confusing when tracking changes in multiple files or trying to get an overview over larger merge requests. It becomes particularly bad with many changes and very nested structures

What is the expected correct behavior?

the order should be consistent

Possible fixes

easiest is probably to reorder diff