Editing a single line of any files using the single file editor is diffing the entire file

Summary

editing a single line of a README using the single file editor is diffing the entire file.

Steps to reproduce

  1. upload a new README file
  2. select edit and then edit single file
  3. make a change to one line
  4. commit changes

⚠️ this happens to any files when it's being edited with single file edtior the first time

Example Project

https://gitlab.com/ms.mondrian/chao-testing-on-prod/-/blob/main/README.md

What is the current bug behavior?

diff is showing the whole file. see https://gitlab.com/ms.mondrian/chao-testing-on-prod/-/commit/06eb80c28c13ad0d5744a88f4f289b815aef03d2

What is the expected correct behavior?

diff should show only one line

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by Chaoyue Zhao