gitlab_git 10.1.2 → 10.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/gitlab_git/blob.rb +12 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dda02206d2c0a9f16eda5badcc9d01ddf2af2de
|
4
|
+
data.tar.gz: fc9d19766ad75865f36e4c8871e0367e2bf8224f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fadadc039ef8b83d6c966f7916530594d8fc16bdff408369a3455743fd03926a8b5bdf6696f97e1f64bb2fe8ee8e9b96062be9e5527b88aaa0e2ee161c4a8668
|
7
|
+
data.tar.gz: e2df413a53ed2c5fc86722090c63ff3644c81522ca7f6e6d61fdf5fb64af4bb19267f34034d36444e74f2110693706cbebb1296f9bde783fac2b047a539f2040
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
10.1.
|
1
|
+
10.1.3
|
data/lib/gitlab_git/blob.rb
CHANGED
@@ -7,10 +7,11 @@ module Gitlab
|
|
7
7
|
include Linguist::BlobHelper
|
8
8
|
include EncodingHelper
|
9
9
|
|
10
|
-
# This number
|
11
|
-
#
|
12
|
-
#
|
13
|
-
|
10
|
+
# This number is the maximum amount of data that we want to display to
|
11
|
+
# the user. We load as much as we can for encoding detection
|
12
|
+
# (Linguist) and LFS pointer parsing. All other cases where we need full
|
13
|
+
# blob data should use load_all_data!.
|
14
|
+
MAX_DATA_DISPLAY_SIZE = 10485760
|
14
15
|
|
15
16
|
attr_accessor :name, :path, :size, :data, :mode, :id, :commit_id
|
16
17
|
|
@@ -33,7 +34,7 @@ module Gitlab
|
|
33
34
|
id: blob.oid,
|
34
35
|
name: blob_entry[:name],
|
35
36
|
size: blob.size,
|
36
|
-
data: blob.content(
|
37
|
+
data: blob.content(MAX_DATA_DISPLAY_SIZE),
|
37
38
|
mode: blob_entry[:filemode].to_s(8),
|
38
39
|
path: path,
|
39
40
|
commit_id: sha,
|
@@ -48,7 +49,7 @@ module Gitlab
|
|
48
49
|
Blob.new(
|
49
50
|
id: blob.oid,
|
50
51
|
size: blob.size,
|
51
|
-
data: blob.content(
|
52
|
+
data: blob.content(MAX_DATA_DISPLAY_SIZE),
|
52
53
|
)
|
53
54
|
end
|
54
55
|
|
@@ -224,7 +225,7 @@ module Gitlab
|
|
224
225
|
encode! @data
|
225
226
|
end
|
226
227
|
|
227
|
-
# Load all blob data (not just the first
|
228
|
+
# Load all blob data (not just the first MAX_DATA_DISPLAY_SIZE bytes) into
|
228
229
|
# memory as a Ruby string.
|
229
230
|
def load_all_data!(repository)
|
230
231
|
return if @data == '' # don't mess with submodule blobs
|
@@ -265,6 +266,10 @@ module Gitlab
|
|
265
266
|
nil
|
266
267
|
end
|
267
268
|
|
269
|
+
def truncated?
|
270
|
+
size > data.size
|
271
|
+
end
|
272
|
+
|
268
273
|
private
|
269
274
|
|
270
275
|
def has_lfs_version_key?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab_git
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 10.1.
|
4
|
+
version: 10.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitriy Zaporozhets
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: github-linguist
|