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:
authorgitlabhq <m@gitlabhq.com>2011-10-25 22:04:31 +0400
committergitlabhq <m@gitlabhq.com>2011-10-25 22:04:31 +0400
commitf6a67fbad5119e3d95e33cfd4f4e4992707d5ba0 (patch)
treebf822b023291a91ea895b4f4dd8cad36ffba8f0b /app/views/commits/_text_file.html.haml
parent9afee5ad5298dc4c89ec74c5fda44adfc91de1b2 (diff)
Issue #87
Diffstat (limited to 'app/views/commits/_text_file.html.haml')
-rw-r--r--app/views/commits/_text_file.html.haml14
1 files changed, 10 insertions, 4 deletions
diff --git a/app/views/commits/_text_file.html.haml b/app/views/commits/_text_file.html.haml
index b20aa8afe40..67033adea7e 100644
--- a/app/views/commits/_text_file.html.haml
+++ b/app/views/commits/_text_file.html.haml
@@ -1,8 +1,14 @@
+- line_old = 0
+- line_new = 0
- 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|
+- 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