Skip to content

Showing more context for a diff in an MR repeats the shown lines

Summary

When clicking on the ... button to show lines before the the diff the loaded lines are incorrect, i.e. the diff section starts repeating, some lines are skipped completely.

Steps to reproduce

  1. Open an MR with diff not at the beginning of the file
  2. Click the button to show lines before the diff
  3. Repeat until the button dissapears

Example Project

Mingan/bug-report!1 (diffs)

What is the current bug behavior?

The basic diff is shown: image

When clicking the button, few preceding lines are shown and then the diff section is repeated: image

On another click, the same thing is repeated: image except that now it claims it reached the beginning of the file.

Inline view behaves slightly differently but still broken. Showing lines after the diff seems ok.

What is the expected correct behavior?

The actual preceding lines should be shown-

Relevant logs and/or screenshots

See above

Output of checks

Happens on Gitlab.com (as linked above) and on private installation of CE (11.1.0 (35c387cb)), started after upgrading from 10.7.