diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /app/serializers/diff_file_entity.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'app/serializers/diff_file_entity.rb')
-rw-r--r-- | app/serializers/diff_file_entity.rb | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/app/serializers/diff_file_entity.rb b/app/serializers/diff_file_entity.rb index 9f8628fe849..aa43b9861d3 100644 --- a/app/serializers/diff_file_entity.rb +++ b/app/serializers/diff_file_entity.rb @@ -55,17 +55,9 @@ class DiffFileEntity < DiffFileBaseEntity end # Used for inline diffs - expose :highlighted_diff_lines, using: DiffLineEntity, if: -> (diff_file, options) { inline_diff_view?(options) && diff_file.text? } do |diff_file| - highlighted_diff_lines_for(diff_file, options) - end + expose :diff_lines_for_serializer, as: :highlighted_diff_lines, using: DiffLineEntity, if: -> (diff_file, options) { inline_diff_view?(options) && diff_file.text? } - expose :is_fully_expanded do |diff_file| - if conflict_file(options, diff_file) - false - else - diff_file.fully_expanded? - end - end + expose :fully_expanded?, as: :is_fully_expanded # Used for parallel diffs expose :parallel_diff_lines, using: DiffLineParallelEntity, if: -> (diff_file, options) { parallel_diff_view?(options) && diff_file.text? } @@ -88,15 +80,6 @@ class DiffFileEntity < DiffFileBaseEntity # If nothing is present, inline will be the default. options.fetch(:diff_view, :inline).to_sym end - - def highlighted_diff_lines_for(diff_file, options) - file = conflict_file(options, diff_file) || diff_file - - file.diff_lines_for_serializer - rescue Gitlab::Git::Conflict::Parser::UnmergeableFile - # Fallback to diff_file as it means that conflict lines can't be parsed due to limit - diff_file.diff_lines_for_serializer - end end DiffFileEntity.prepend_mod |