diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-06-20 19:23:46 +0200 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-07-06 18:51:00 -0400 |
commit | 29d574868a044fbfdf7a2458fbb3d951cfe58171 (patch) | |
tree | 5344a08af20c1e0bb3fb50ad8dd696485bd0946a /lib | |
parent | 521a0a20f7b52a2fb6ea209b39824a752f2613bd (diff) | |
download | gitlab-ce-29d574868a044fbfdf7a2458fbb3d951cfe58171.tar.gz |
Display new diff notes and allow creation through the web interface
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/diff/parallel_diff.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/gitlab/diff/parallel_diff.rb b/lib/gitlab/diff/parallel_diff.rb index 2d15b64fdb0..1c1fc148123 100644 --- a/lib/gitlab/diff/parallel_diff.rb +++ b/lib/gitlab/diff/parallel_diff.rb @@ -18,6 +18,7 @@ module Gitlab line_code = diff_file.line_code(line) line_new = line.new_pos line_old = line.old_pos + position = diff_file.position(line) next_line = diff_file.next_line(line.index) @@ -26,6 +27,7 @@ module Gitlab full_next_line = next_line.text next_line_code = diff_file.line_code(next_line) next_type = next_line.type + next_position = diff_file.position(next_line) end case type @@ -37,12 +39,14 @@ module Gitlab number: line_old, text: full_line, line_code: line_code, + position: position }, right: { type: type, number: line_new, text: full_line, - line_code: line_code + line_code: line_code, + position: position } } when 'old' @@ -55,12 +59,14 @@ module Gitlab number: line_old, text: full_line, line_code: line_code, + position: position }, right: { type: next_type, number: line_new, text: full_next_line, line_code: next_line_code, + position: next_position, } } skip_next = true @@ -73,12 +79,14 @@ module Gitlab number: line_old, text: full_line, line_code: line_code, + position: position }, right: { type: next_type, number: nil, text: "", - line_code: nil + line_code: nil, + position: nil } } end @@ -95,12 +103,14 @@ module Gitlab number: nil, text: "", line_code: line_code, + position: position }, right: { type: type, number: line_new, text: full_line, - line_code: line_code + line_code: line_code, + position: position } } end |