Can't create a merge request containing a binary file with non-UTF-8 characters
This was introduced in 9.4.0. Previously, we stored MR diffs as serialised YAML text in a text field. Now, we store them in a table with columns for each attribute of the hash, and the diff itself is stored in a text field.
However, Psych tags binary values and encodes them as base 64 if they aren't ASCII-compatible:
We need to do the same thing here, and add a boolean
binary column to this table. I think we can get away with the simpler check, like in https://github.com/ruby/psych/commit/8949a47b8cee31e03e21608406ba116adcf74054.
This will also be necessary when migrating the legacy data, as in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12685.