gitlab_git 10.1.1 → 10.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 496965fbe870ebb721b318e505e59cc98d498a85
4
- data.tar.gz: dd57cd988aa8e107671960fab9e95b9670b2b056
3
+ metadata.gz: d11e929a847b0ead24d039c132c3fa3c05815c61
4
+ data.tar.gz: 8e965143c170a140628ca39097c50d616bdd268b
5
5
  SHA512:
6
- metadata.gz: b5aa54533ab2ffc0ba142c7826df82a253e6e480c6b83f14395196c98dea093326524812df00c95a4803038e3a01fd67d8a2e724e447e9068a72451d0cda6d07
7
- data.tar.gz: 6d70a21c64578a219483de6315e69d52d94b94b031159f77a2e6b7a78f206e9f09d1c7279df7bb318f7d9b508b63e3941d7c141ea253af5105f289f7f88e6557
6
+ metadata.gz: 5785a2fefa0fab91f006078947d0bf8ebf660450cc001296a46b8fb42203f5379a1e88ddcb01d9a1e7c1ab71e56591e4994c41def24764de6b959058753104ca
7
+ data.tar.gz: 3976529a53e2a7ffc68c21ce8c7fe2fb38de5bbe70ca72f80b386b9d5390c2c9e2ff41d736bc17dd5205b307689245adf8a31949815a92799eccbf08a537b9a5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 10.1.1
1
+ 10.1.2
@@ -212,6 +212,8 @@ module Gitlab
212
212
  %w(id name path size data mode commit_id).each do |key|
213
213
  self.send("#{key}=", options[key.to_sym])
214
214
  end
215
+
216
+ @loaded_all_data = false
215
217
  end
216
218
 
217
219
  def empty?
@@ -226,7 +228,9 @@ module Gitlab
226
228
  # memory as a Ruby string.
227
229
  def load_all_data!(repository)
228
230
  return if @data == '' # don't mess with submodule blobs
231
+ return @data if @loaded_all_data
229
232
 
233
+ @loaded_all_data = true
230
234
  @data = repository.lookup(id).content
231
235
  end
232
236
 
@@ -9,9 +9,11 @@ module Gitlab
9
9
  @iterator = iterator
10
10
  @max_files = options.fetch(:max_files, DEFAULT_LIMITS[:max_files])
11
11
  @max_lines = options.fetch(:max_lines, DEFAULT_LIMITS[:max_lines])
12
+ @max_bytes = @max_files * 5120 # Average 5 KB per file
12
13
  @all_diffs = !!options.fetch(:all_diffs, false)
13
14
 
14
15
  @line_count = 0
16
+ @byte_count = 0
15
17
  @overflow = false
16
18
  @array = Array.new
17
19
  end
@@ -46,8 +48,9 @@ module Gitlab
46
48
  end
47
49
 
48
50
  @line_count += diff.line_count
51
+ @byte_count += diff.diff.bytesize
49
52
 
50
- if !@all_diffs && @line_count >= @max_lines
53
+ if !@all_diffs && (@line_count >= @max_lines || @byte_count >= @max_bytes)
51
54
  # This last Diff instance pushes us over the lines limit. We stop and
52
55
  # discard it.
53
56
  @overflow = true
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.1
4
+ version: 10.1.2
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-05-06 00:00:00.000000000 Z
11
+ date: 2016-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github-linguist
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.4.8
128
+ rubygems_version: 2.2.5
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Gitlab::Git library