diff options
author | Cedric Gatay <cedric@gatay.fr> | 2012-02-22 19:04:41 +0400 |
---|---|---|
committer | Cedric Gatay <cedric@gatay.fr> | 2012-02-22 19:04:41 +0400 |
commit | 6ea87c47f0f8a24ae031c3fff17bc913889ecd00 (patch) | |
tree | 86c831ab21236f21ffa5b97c752369612ce41b39 | |
parent | 8c40aab120dbc5507ab9cc8d7ad8e2519d6e9f25 (diff) |
Incorrect line numbering in diff
When displaying a diff, the line number always starts at one, even if the first diff is not at the first line
Fixes this to display correct line numbering on first diff
-rw-r--r-- | app/helpers/commits_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 3ed8e8c3946..d097c2712eb 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -61,12 +61,12 @@ module CommitsHelper full_line = html_escape(line.gsub(/\n/, '')).force_encoding("UTF-8") if line.match(/^@@ -/) - next if line_old == 1 && line_new == 1 type = "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 if line_old == 1 && line_new == 1 yield(line, type, nil, nil, nil) next else |