[go: up one dir, main page]

Viewing a file and have a line selected, switching branch redirects to project's home page.

Summary

While viewing a file, if one switches a branch while a line is selected (that is, there exist #L<n> in the URL in the address box), the page cannot find the file.

Steps to reproduce

  1. Go to some project which has at least 2 branches containing the file at the same path.
  2. Open the file. Then, select a line by clicking the line number on the left. Notice that #L<n> (where n is a line number) appears in the address bar.
  3. Switch to the other branch using the branch switcher near the top of the page.

Example Project

I don't think this is project-related, but it's reproducible on https://gitlab.com/ubports/core/packaging/qtbase/-/tree/ubports/xenial_-_qt-5-12

What is the current bug behavior?

The UI will redirect to the project's homepage citing "<filename>#L<n>" doesn't exist on <branch>., even though the file does exist.

What is the expected correct behavior?

The UI should display the content of that file in a different branch, preferably at the selected line.

Relevant logs and/or screenshots

image

Output of checks

This bug happens on GitLab.com