Commit 9e6d0710e927aa8ea834b8a9ae9f277be617ac7d

Authored by Dmitriy Zaporozhets
2 parents 8c40aab1 6ea87c47

Merge pull request #443 from CedricGatay/fix/incorrectLineNumberingInDiff

Incorrect line numbering in diff
Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
app/helpers/commits_helper.rb
... ... @@ -61,12 +61,12 @@ module CommitsHelper
61 61 full_line = html_escape(line.gsub(/\n/, '')).force_encoding("UTF-8")
62 62  
63 63 if line.match(/^@@ -/)
64   - next if line_old == 1 && line_new == 1
65 64 type = "match"
66 65  
67 66 line_old = line.match(/\-[0-9]*/)[0].to_i.abs rescue 0
68 67 line_new = line.match(/\+[0-9]*/)[0].to_i.abs rescue 0
69   -
  68 +
  69 + next if line_old == 1 && line_new == 1
70 70 yield(line, type, nil, nil, nil)
71 71 next
72 72 else
... ...