Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-09-03 12:07:39 +0300
committerSean McGivern <sean@mcgivern.me.uk>2018-09-03 12:07:39 +0300
commit91ed0dbc8cd96b63e5fca32fc127df9262b2dcd2 (patch)
tree1081a00ec39876e34610abe0e299814f71320777 /lib
parentb5be01bc1fb3dc075eb7a73ef55098ecd5515234 (diff)
parent5bc54ca425866c37f6cdf6448d8ae2dcbabea3bf (diff)
Merge branch 'issue_48084' into 'master'
Use a serializer to render diff lines Closes #48084 See merge request gitlab-org/gitlab-ce!21260
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/diff/line.rb12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/gitlab/diff/line.rb b/lib/gitlab/diff/line.rb
index 1ab6df0b6ae..5b67cd46c48 100644
--- a/lib/gitlab/diff/line.rb
+++ b/lib/gitlab/diff/line.rb
@@ -79,16 +79,10 @@ module Gitlab
}
end
+ # We have to keep this here since it is still used for conflict resolution
+ # Conflict::File#as_json renders json diff lines in sections
def as_json(opts = nil)
- {
- line_code: line_code,
- type: type,
- old_line: old_line,
- new_line: new_line,
- text: text,
- rich_text: rich_text || CGI.escapeHTML(text),
- meta_data: meta_positions
- }
+ DiffLineSerializer.new.represent(self)
end
private