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

21 lines
541 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
2011-11-09 14:53:15 +01:00
- elsif line[0] == "-"
2011-10-21 20:40:36 +02:00
- line_old += 1
- else
2011-10-21 20:40:36 +02:00
- line_new += 1
- line_old += 1