diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-05-31 19:33:46 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-05-31 19:33:46 -0300 |
commit | 56f3b243ce08d105758a9b6edf96792627fa423c (patch) | |
tree | 6b8f0a2e47b5c3d43d34c2c2b25e1596ea7e501f /lib/gitlab/diff | |
parent | 30e61ed79c89de4c31a4d2057f710ad2b0704389 (diff) | |
download | gitlab-ce-56f3b243ce08d105758a9b6edf96792627fa423c.tar.gz |
Add leading comment space copissue_15557
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r-- | lib/gitlab/diff/parser.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/gitlab/diff/parser.rb b/lib/gitlab/diff/parser.rb index 6fe7faa547a..522dd2b9428 100644 --- a/lib/gitlab/diff/parser.rb +++ b/lib/gitlab/diff/parser.rb @@ -17,16 +17,16 @@ module Gitlab Enumerator.new do |yielder| @lines.each do |line| next if filename?(line) - + full_line = line.delete("\n") - + if line.match(/^@@ -/) type = "match" - + line_old = line.match(/\-[0-9]*/)[0].to_i.abs rescue 0 line_new = line.match(/\+[0-9]*/)[0].to_i.abs rescue 0 - - next if line_old <= 1 && line_new <= 1 #top of file + + next if line_old <= 1 && line_new <= 1 # top of file yielder << Gitlab::Diff::Line.new(full_line, type, line_obj_index, line_old, line_new) line_obj_index += 1 next @@ -39,8 +39,8 @@ module Gitlab yielder << Gitlab::Diff::Line.new(full_line, type, line_obj_index, line_old, line_new) line_obj_index += 1 end - - + + case line[0] when "+" line_new += 1 |