diff options
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 |