diff options
author | Sean McGivern <sean@gitlab.com> | 2016-08-02 11:20:22 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-08-12 23:24:46 +0300 |
commit | 261d47bce9d7cc80b4c2068cb612411fe51530ee (patch) | |
tree | 2f913169220c9e9e6d4e5e1610b085dedbdf864e /lib/gitlab/diff | |
parent | 6f3501fe252404b342984514b1b784ffa73edbd0 (diff) |
Fix specs
- Add match line header to expected result for `File#sections`.
- Lowercase CSS colours.
- Remove unused `diff_refs` keyword argument.
- Rename `parent` -> `parent_file`, to be more explicit.
- Skip an iteration when highlighting.
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r-- | lib/gitlab/diff/line.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/diff/line.rb b/lib/gitlab/diff/line.rb index 38400b48b5c..80a146b4a5a 100644 --- a/lib/gitlab/diff/line.rb +++ b/lib/gitlab/diff/line.rb @@ -5,10 +5,10 @@ module Gitlab attr_writer :rich_text attr_accessor :text - def initialize(text, type, index, old_pos, new_pos, parent: nil) + def initialize(text, type, index, old_pos, new_pos, parent_file: nil) @text, @type, @index = text, type, index @old_pos, @new_pos = old_pos, new_pos - @parent = parent + @parent_file = parent_file end def self.init_from_hash(hash) @@ -46,7 +46,7 @@ module Gitlab end def rich_text - @parent.highlight_lines! if @parent && !@rich_text + @parent_file.highlight_lines! if @parent_file && !@rich_text @rich_text end |