Cannot view files called diff

Summary

When naming a file "diff", it's impossible to view it in the Repository tab, in any directory. Clicking on the file will go back to showing the folder that the file is in.

Steps to reproduce

  1. Create a repository
  2. Create a file called "diff" in the repository with whatever content
  3. Navigate to https://gitlab.com/user/repo/blob/master/diff

Example Project

https://gitlab.com/aapeli/diffbug/

Here https://gitlab.com/aapeli/diffbug/blob/master/diff redirects back to https://gitlab.com/aapeli/diffbug/tree/master/

What is the current bug behavior?

User is redirected to the directory that the "diff" file lives in

What is the expected correct behavior?

User should be taken to the page for the file to view or edit the source

Relevant logs and/or screenshots

N/A

Output of checks

This bug happens on GitLab.com and GitLab CE.

Results of GitLab environment info

N/A

Results of GitLab application Check

N/A

Possible fixes

N/A

Assignee Loading
Time tracking Loading