summaryrefslogtreecommitdiff
path: root/app/helpers/commits_helper.rb
diff options
context:
space:
mode:
authorGeorge Dewar <george.dewar@datacom.co.nz>2014-04-17 14:36:43 +1200
committerGeorge Dewar <george.dewar@datacom.co.nz>2014-04-17 14:42:05 +1200
commit5ef7fdbd54ef41de01b64b4df58529d4bf3c62a3 (patch)
tree4d9f3729eef67401e19779820129609b868f8cb8 /app/helpers/commits_helper.rb
parent9b52affe31f2496fb10ae1d90b21f42ed173b7dc (diff)
downloadgitlab-ce-5ef7fdbd54ef41de01b64b4df58529d4bf3c62a3.tar.gz
Fix bug in which a line count without empty lines was incorrectly used
Diffstat (limited to 'app/helpers/commits_helper.rb')
-rw-r--r--app/helpers/commits_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index c6e4f574b67..b02be4623fd 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -116,7 +116,7 @@ module CommitsHelper
added_lines[line_new] = { line_code: line_code, type: type, line: line }
end
end
- max_length = old_file ? old_file.sloc + added_lines.length : file.sloc
+ max_length = old_file ? [old_file.loc, file.loc].max : file.loc
offset1 = 0
offset2 = 0