diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /lib/gitlab/diff | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r-- | lib/gitlab/diff/line.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/diff/position.rb | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/gitlab/diff/line.rb b/lib/gitlab/diff/line.rb index af9140215f0..98ed2400d82 100644 --- a/lib/gitlab/diff/line.rb +++ b/lib/gitlab/diff/line.rb @@ -8,9 +8,9 @@ module Gitlab # SERIALIZE_KEYS = %i(line_code rich_text text type index old_pos new_pos).freeze - attr_reader :line_code, :old_pos, :new_pos + attr_reader :line_code attr_writer :rich_text - attr_accessor :text, :index, :type + attr_accessor :text, :index, :type, :old_pos, :new_pos def initialize(text, type, index, old_pos, new_pos, parent_file: nil, line_code: nil, rich_text: nil) @text, @type, @index = text, type, index diff --git a/lib/gitlab/diff/position.rb b/lib/gitlab/diff/position.rb index e43f301c280..74c33c46598 100644 --- a/lib/gitlab/diff/position.rb +++ b/lib/gitlab/diff/position.rb @@ -19,6 +19,7 @@ module Gitlab :height, :x, :y, + :line_range, :position_type, to: :formatter # A position can belong to a text line or to an image coordinate @@ -167,6 +168,12 @@ module Gitlab end end + def multiline? + return unless on_text? && line_range + + line_range['start'] != line_range['end'] + end + private def find_diff_file(repository) |