summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-04-18 01:47:27 +0000
committerRobert Speicher <robert@gitlab.com>2017-04-18 01:47:27 +0000
commit2b934a7f43feff6889b51a1cd2aadc9afb3f25d8 (patch)
tree3f7581811c69908f6873bc1ae243a6dc839e8cf9 /lib
parent60196e8bcce1b74d5dee8021f3c69aa8e0aff717 (diff)
parentd6f49b85f1cdba077f0046534314ed562a9ed418 (diff)
downloadgitlab-ce-2b934a7f43feff6889b51a1cd2aadc9afb3f25d8.tar.gz
Merge branch 'dm-git-blob-sizes' into 'master'
Normalize sizes in Gitlab::Git::Blob See merge request !10742
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/git/blob.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/git/blob.rb b/lib/gitlab/git/blob.rb
index e56eb0d3beb..98fd4e78126 100644
--- a/lib/gitlab/git/blob.rb
+++ b/lib/gitlab/git/blob.rb
@@ -8,7 +8,7 @@ module Gitlab
# the user. We load as much as we can for encoding detection
# (Linguist) and LFS pointer parsing. All other cases where we need full
# blob data should use load_all_data!.
- MAX_DATA_DISPLAY_SIZE = 10485760
+ MAX_DATA_DISPLAY_SIZE = 10.megabytes
attr_accessor :name, :path, :size, :data, :mode, :id, :commit_id, :loaded_size, :binary
@@ -153,7 +153,7 @@ module Gitlab
def lfs_size
if has_lfs_version_key?
size = data.match(/(?<=size )([0-9]+)/)
- return size[1] if size
+ return size[1].to_i if size
end
nil