Permalink button drops the `#LXX` URL parameter

Summary

When viewing a file, clicking the "Permalink" button will cause any previously-selected line reference (e.g. #L32) to be dropped from the URL.

Steps to reproduce

  1. Navigate to a file view, i.e. https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/views/shared/milestones/_sidebar.html.haml
  2. Select a specific line by clicking on a line number. Notice that a URL parameter like #LXX has been appended to the current URL in your browser's address bar.
  3. Click the "Permalink" button

What is the current bug behavior?

The new URL no longer includes the #LXX parameter.

What is the expected correct behavior?

The new URL should still contain the #LXX parameter that existed before the "Permalink" button was clicked.

Output of checks

This bug happens on GitLab.com.