Skip to content

Fix bug branch change with line selected

What does this MR do?

Fix the problem when the branch change with a line(s) selected.

Problem Fixed
branch-change-not-displaying-file-line FIXED

Testing Case

  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.
  • The other branch should display the same file with the line number selected
master another-branch
image image
  • If multiple lines are selected, it will also work
master another-branch
image image
  • If a line selected exist in one branch but not the other, it will still display the file, with no line highlighted
master another-branch
image image

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #296667 (closed)

Edited by Samantha Ming

Merge request reports