Unable to load commit data on branch where the branch name contains a hash

Summary

When browsing to a branch in GitLab where the branch name contains a # character and error is displayed at the top of the page stating

An error occurred while fetching commit data.

The commit data usually displayed on the repository view also never loads: image

Steps to reproduce

  1. in any project edit a file in the WebIDE
  2. click on Create Commit, select Create a new branch and enter a new branch name containing a hash (for example #test/dayo)
  3. show https://gitlab.com/user-name/project-name/-/tree/%23test/dayo?ref_type=heads

What is the current bug behavior?

Any branches that contain # in their names cannot load the commit data.

What is the expected correct behavior?

The commit data should load regardless of the characters used in the branch name

version

A bug occurred in version "Community Edition" 16.11.2.

It didn't happen on "Community Edition" 16.9.1.

The same bug occurs on gitlab.com.

Edited by