MR Changes file list and diff view show files in different order
Summary
The order in which GitLab shows files in the file list opened in tree view is inconsistent with the order of the diff of these files on the right, and inconsistent with the order of the files in the list when opened in list view.
Screenshot shows that the order of the files is different in the file list and in the diff list.
Steps to reproduce
- Create two folders, where one is named
example
and otherexample-something
. The important part here is that one of the folders has the other folder name as a prefix, the rest isn't important, there are probably other characters with which the bug can be triggered besides-
. - Create files in the
example-something
folder. - Create files in a subdirectory of
example
, e.g. inexample/subdir
. This will cause the file tree viewer to showexample/subdir
as a common element, which will break the sort order. - View the files in a diff viewer. Besides the MR diff viewer this behavior is probably reproducible in the Rapid Diff viewer as well, when used with the file tree.
Example Project
renbou/gitlab-bug-reproduce!2 (diffs)
What is the current bug behavior?
When file list is used in tree view it sometimes shows the files in a different order than they are displayed in the diff view due to elements being sorted after they are aggregated (e.g. dir and subdir are combined into one element in the tree).
What is the expected correct behavior?
File tree view order is always consistent with the file diff order.
Edited by 🤖 GitLab Bot 🤖