Skip to content

Fix encoding error in MR diffs

What does this MR do?

Fix encoding error in MR diffs when using external diff storage.

You need to clear diff highlight cache if you are using external diff storage. You can clear diff highlight cache as described below.

  1. Enter rails console
sudo gitlab-ctl console
  1. Clear cache
MergeRequestDiff.in_batches do |merge_request_diffs|
  merge_request_diffs.where(stored_externally: true).each do |merge_request_diff|
    cache = Gitlab::Diff::HighlightCache.new(merge_request_diff.diffs)
    cache.clear
  end
end

Conformity

Performance and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #61841 (moved)

Edited by Hiroyuki Sato

Merge request reports