Commit 9e6d0710e927aa8ea834b8a9ae9f277be617ac7d
Exists in
master
and in
4 other branches
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,12 +61,12 @@ module CommitsHelper | ||
| 61 | full_line = html_escape(line.gsub(/\n/, '')).force_encoding("UTF-8") | 61 | full_line = html_escape(line.gsub(/\n/, '')).force_encoding("UTF-8") |
| 62 | 62 | ||
| 63 | if line.match(/^@@ -/) | 63 | if line.match(/^@@ -/) |
| 64 | - next if line_old == 1 && line_new == 1 | ||
| 65 | type = "match" | 64 | type = "match" |
| 66 | 65 | ||
| 67 | line_old = line.match(/\-[0-9]*/)[0].to_i.abs rescue 0 | 66 | line_old = line.match(/\-[0-9]*/)[0].to_i.abs rescue 0 |
| 68 | line_new = line.match(/\+[0-9]*/)[0].to_i.abs rescue 0 | 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 | yield(line, type, nil, nil, nil) | 70 | yield(line, type, nil, nil, nil) |
| 71 | next | 71 | next |
| 72 | else | 72 | else |