-
- Downloads
Fix saving diffs that are not valid UTF-8
Previously, we used Psych, which would: 1. Check if a string was encoded as binary, and not ASCII-compatible. 2. Add the !binary tag in that case. 3. Convert to base64. We need to do the same thing, using a new column in place of the tag.
Showing
- app/models/merge_request_diff.rb 13 additions, 4 deletionsapp/models/merge_request_diff.rb
- app/models/merge_request_diff_file.rb 10 additions, 0 deletionsapp/models/merge_request_diff_file.rb
- changelogs/unreleased/35539-can-t-create-a-merge-request-containing-a-binary-file-with-non-utf-8-characters.yml 5 additions, 0 deletions...st-containing-a-binary-file-with-non-utf-8-characters.yml
- db/migrate/20170725145659_add_binary_to_merge_request_diff_files.rb 9 additions, 0 deletions.../20170725145659_add_binary_to_merge_request_diff_files.rb
- db/schema.rb 2 additions, 1 deletiondb/schema.rb
- spec/features/projects/ref_switcher_spec.rb 2 additions, 2 deletionsspec/features/projects/ref_switcher_spec.rb
- spec/lib/gitlab/import_export/safe_model_attributes.yml 1 addition, 0 deletionsspec/lib/gitlab/import_export/safe_model_attributes.yml
- spec/models/merge_request_diff_file_spec.rb 26 additions, 1 deletionspec/models/merge_request_diff_file_spec.rb
- spec/models/merge_request_diff_spec.rb 9 additions, 0 deletionsspec/models/merge_request_diff_spec.rb
- spec/support/test_env.rb 2 additions, 1 deletionspec/support/test_env.rb
Please register or sign in to comment