gitlab-org--gitlab-foss/app/views/commits/_text_file.html.haml

16 lines
405 B
Text
Raw Normal View History

2011-10-21 14:40:36 -04:00
- lines_arr = diff.diff.lines.to_a
- line_old = lines_arr[2].match(/-(\d)/)[0].to_i.abs rescue 0
- line_new = lines_arr[2].match(/\+(\d)/)[0].to_i.abs rescue 0
- lines = lines_arr[3..-1].join
- lines.each_line do |line|
= diff_line(line, line_new, line_old)
- if line[0] == "+"
- line_new += 1
- elsif
- line[0] == "-"
- line_old += 1
- else
- line_new += 1
- line_old += 1