Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaito <saitowu@gmail.com>2011-12-01 11:59:49 +0400
committerSaito <saitowu@gmail.com>2011-12-01 11:59:49 +0400
commit42ba6d04f84b722bc1212378633cd8c05a2c6ded (patch)
treee538047a1e29d30ef908266c1395e19b142b577e /app/views/commits/_text_file.html.haml
parentc2cfc52e449a7bcd817909ace4ab8926509ee4f2 (diff)
refactor each_line detect to detect all diff file
Diffstat (limited to 'app/views/commits/_text_file.html.haml')
-rw-r--r--app/views/commits/_text_file.html.haml6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/views/commits/_text_file.html.haml b/app/views/commits/_text_file.html.haml
index e39cf11700e..22fe5582dfd 100644
--- a/app/views/commits/_text_file.html.haml
+++ b/app/views/commits/_text_file.html.haml
@@ -1,9 +1,9 @@
%table
- line_old = 0
- line_new = 0
- - lines_arr = diff.diff.lines.to_a
+ - diff_str = encode(diff.diff)
+ - lines_arr = diff_str.lines.to_a
- lines_arr.each do |line|
- - line = encode(line)
- next if line.match(/^--- \/dev\/null/)
- next if line.match(/^--- a/)
- next if line.match(/^\+\+\+ b/)
@@ -18,7 +18,7 @@
= link_to raw(diff_line_class(line) == "new" ? "&nbsp;" : line_old), "#OLD#{index}-#{line_old}", :id => "OLD#{index}-#{line_old}"
%td.new_line
= link_to raw(diff_line_class(line) == "old" ? "&nbsp;" : line_new) , "#NEW#{index}-#{line_new}", :id => "NEW#{index}-#{line_new}"
- %td.line_content{:class => diff_line_class(full_line)}= raw "#{full_line} &nbsp;"
+ %td.line_content{:class => diff_line_class(full_line)}= raw "#{full_line} &nbsp;"
- if line[0] == "+"
- line_new += 1
- elsif line[0] == "-"