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
- Open an MR with diff not at the beginning of the file
- Click the button to show lines before the diff
- Repeat until the button dissapears
Example Project
What is the current bug behavior?
When clicking the button, few preceding lines are shown and then the diff section is repeated:

On another click, the same thing is repeated:
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.
