gitlabhq/app/views/commits/_text_file.html.haml

23 lines
548 B
Plaintext
Raw Normal View History

2011-10-25 20:04:31 +02:00
- line_old = 0
- line_new = 0
2011-10-21 20:40:36 +02:00
- lines_arr = diff.diff.lines.to_a
2011-10-25 20:04:31 +02:00
- lines_arr.each do |line|
2011-10-27 15:50:35 +02:00
- next if line.match(/^--- \/dev\/null/)
2011-10-25 20:04:31 +02:00
- next if line.match(/^--- a/)
- next if line.match(/^\+\+\+ b/)
- if line.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
2011-10-21 20:40:36 +02:00
= diff_line(line, line_new, line_old)
- if line[0] == "+"
- line_new += 1
- elsif
2011-10-21 20:40:36 +02:00
- line[0] == "-"
- line_old += 1
- else
2011-10-21 20:40:36 +02:00
- line_new += 1
- line_old += 1