Toggle show whitespace changes on and off while viewing diff triggers download file
Summary
When viewing diff in Merge Request, clicking expand and then clicking Show whitespace changes
, some changed files will show a download button instead.
Steps to reproduce
- Open a MR
- Make a small change to a file and push to the MR branch
- View diff in MR page
- Click
Click to expand it.
to view changes - Click on the Cog icon > Tick or untick
Show whitespace changes
- Click
Click to expand it.
to view changes on the file again - See the Download button even though there's only a few lines change
Example Project
Can be seen in this MR: !43730 (merged)
What is the current bug behavior?
Some diffs will not be viewable and will instead show a download button
What is the expected correct behavior?
Diffs will show on the changes page without showing a download button
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
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
Uncheck "Show whitespace changes"