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
- Go to some project which has at least 2 branches containing the file at the same path.
- Open the file. Then, select a line by clicking the line number on the left. Notice that
#L<n>
(wheren
is a line number) appears in the address bar. - 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 |
---|---|
-
If multiple lines are selected, it will also work
master | another-branch |
---|---|
-
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 |
---|---|
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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