gitlabhq/app/views/commits/_text_file.html.haml
Nihad Abbasov d62200cad4 clean-up code
* Remove trailing whitespace
  * Converts hard-tabs into two-space soft-tabs
  * Remove consecutive blank lines
2011-10-26 18:46:25 +05:00

22 lines
505 B
Plaintext

- line_old = 0
- line_new = 0
- lines_arr = diff.diff.lines.to_a
- lines_arr.each do |line|
- 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
= 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