MR diff trying to render diff for large files and rendering it incorrectly

Summary

MR diff trying to render diff for large files and rendering it incorrectly

Steps to reproduce

  1. Have a file with more than 2MB on your repo
  2. Create an MR to change a line in that file
  3. Navigate to the MR diff view

Example Project

tpresa/test-mr-diff-limits!1 (diffs)

What is the current bug behavior?

MR view is trying to render the diff, and the rendered diff is not correct (shows file has 4 lines, when in fact it has far more.

What is the expected correct behavior?

MR view would say that the diff is too large to be rendered. This is what happens if we cut the file down to a bit less than 1MB

Output of checks

This bug happens on GitLab.com

ZD https://gitlab.zendesk.com/agent/tickets/128257

Assignee Loading
Time tracking Loading