gitlab_git 10.1.2 → 10.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/gitlab_git/blob.rb +12 -7
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d11e929a847b0ead24d039c132c3fa3c05815c61
4
- data.tar.gz: 8e965143c170a140628ca39097c50d616bdd268b
3
+ metadata.gz: 7dda02206d2c0a9f16eda5badcc9d01ddf2af2de
4
+ data.tar.gz: fc9d19766ad75865f36e4c8871e0367e2bf8224f
5
5
  SHA512:
6
- metadata.gz: 5785a2fefa0fab91f006078947d0bf8ebf660450cc001296a46b8fb42203f5379a1e88ddcb01d9a1e7c1ab71e56591e4994c41def24764de6b959058753104ca
7
- data.tar.gz: 3976529a53e2a7ffc68c21ce8c7fe2fb38de5bbe70ca72f80b386b9d5390c2c9e2ff41d736bc17dd5205b307689245adf8a31949815a92799eccbf08a537b9a5
6
+ metadata.gz: fadadc039ef8b83d6c966f7916530594d8fc16bdff408369a3455743fd03926a8b5bdf6696f97e1f64bb2fe8ee8e9b96062be9e5527b88aaa0e2ee161c4a8668
7
+ data.tar.gz: e2df413a53ed2c5fc86722090c63ff3644c81522ca7f6e6d61fdf5fb64af4bb19267f34034d36444e74f2110693706cbebb1296f9bde783fac2b047a539f2040
data/VERSION CHANGED
@@ -1 +1 @@
1
- 10.1.2
1
+ 10.1.3
@@ -7,10 +7,11 @@ module Gitlab
7
7
  include Linguist::BlobHelper
8
8
  include EncodingHelper
9
9
 
10
- # This number needs to be large enough to allow reliable content /
11
- # encoding detection (Linguist) and LFS pointer parsing. All other cases
12
- # where we need full blob data should use load_all_data!.
13
- DATA_FRAGMENT_SIZE = 1024
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(DATA_FRAGMENT_SIZE),
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(DATA_FRAGMENT_SIZE),
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 DATA_FRAGMENT_SIZE bytes) into
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.2
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-08 00:00:00.000000000 Z
11
+ date: 2016-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github-linguist