summaryrefslogtreecommitdiff
path: root/lib/gitlab/diff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2016-07-25 19:47:09 +0100
committerFatih Acet <acetfatih@gmail.com>2016-08-12 23:24:43 +0300
commitdf2ed097b730c8ba0b79cac8cc3dbfcb0cf587cb (patch)
treecf81b693a81e9bca1a5044706a4ba12c041bf55f /lib/gitlab/diff
parentff15fbf10c8c32fde876e5c9578fdc2161b7905c (diff)
downloadgitlab-ce-df2ed097b730c8ba0b79cac8cc3dbfcb0cf587cb.tar.gz
Add backend for merge conflicts reading
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r--lib/gitlab/diff/line.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/gitlab/diff/line.rb b/lib/gitlab/diff/line.rb
index cf097e0d0de..5196051f90d 100644
--- a/lib/gitlab/diff/line.rb
+++ b/lib/gitlab/diff/line.rb
@@ -3,6 +3,7 @@ module Gitlab
class Line
attr_reader :type, :index, :old_pos, :new_pos
attr_accessor :text
+ attr_accessor :rich_text
def initialize(text, type, index, old_pos, new_pos)
@text, @type, @index = text, type, index
@@ -46,6 +47,16 @@ module Gitlab
def meta?
type == 'match' || type == 'nonewline'
end
+
+ def as_json(opts = nil)
+ {
+ type: type,
+ old_line: old_line,
+ new_line: new_line,
+ text: text,
+ rich_text: rich_text || text
+ }
+ end
end
end
end