diff options
author | Sean McGivern <sean@gitlab.com> | 2017-08-11 13:58:21 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-08-11 13:58:36 +0300 |
commit | d2315054e6e8398fade9795f72830550b03fda0f (patch) | |
tree | 18bdc2ebbcb9a68ba3dfa3034b1f58a4ab80ec95 /lib/gitlab | |
parent | 86f5a4aaf19935b4d23a81426c1576bc16024696 (diff) |
Fix merge request diff deserialisation when too_large was absent
Not all diffs in st_diffs had the too_large attribute set at all, but the column
is non-nullable. Explicitly cast to boolean to avoid that problem.
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits.rb b/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits.rb index 0fbc6b70989..310a69a4bd4 100644 --- a/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits.rb +++ b/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits.rb @@ -85,6 +85,8 @@ module Gitlab diff_hash.tap do |hash| diff_text = hash[:diff] + hash[:too_large] = !!hash[:too_large] + if diff_text.encoding == Encoding::BINARY && !diff_text.ascii_only? hash[:binary] = true hash[:diff] = [diff_text].pack('m0') |