gitlab_git 10.4.1 → 10.4.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 +4 -4
- data/VERSION +1 -1
- data/lib/gitlab_git/diff_collection.rb +47 -38
- data/lib/gitlab_git/repository.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e30dbf365616d1882c82f8b7dab9df82a263fbbd
|
4
|
+
data.tar.gz: 2fa32f9affdc6f0b431b598b463c7c0a8584aa4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b39cbb770c89b34fc94a9e9758ddc7ef8be5ceb89c6f403c85ba3b883ef9f1ee0ca4ba86b806ffb1b04363716e5941f5ba52cd90428f47ace13de9c043480fe0
|
7
|
+
data.tar.gz: 987439cb257e6b0dbcfb794f522888ed47ca63a1d7c04c8c5fdff607fd27cad6569e01ecdfef2cabb6de6122861caf8be38a9970bfb4622c74fe646d6a20fdf0
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
10.4.
|
1
|
+
10.4.2
|
@@ -23,51 +23,58 @@ module Gitlab
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def each
|
26
|
-
@
|
27
|
-
#
|
28
|
-
|
29
|
-
yield
|
30
|
-
next
|
26
|
+
if @populated
|
27
|
+
# @iterator.each is slower than just iterating the array in place
|
28
|
+
@array.each do |item|
|
29
|
+
yield item
|
31
30
|
end
|
31
|
+
else
|
32
|
+
@iterator.each_with_index do |raw, i|
|
33
|
+
# First yield cached Diff instances from @array
|
34
|
+
if @array[i]
|
35
|
+
yield @array[i]
|
36
|
+
next
|
37
|
+
end
|
32
38
|
|
33
|
-
|
34
|
-
|
39
|
+
# We have exhausted @array, time to create new Diff instances or stop.
|
40
|
+
break if @overflow
|
35
41
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
42
|
+
if !@all_diffs && i >= @max_files
|
43
|
+
@overflow = true
|
44
|
+
break
|
45
|
+
end
|
40
46
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
47
|
+
# Going by the number of files alone it is OK to create a new Diff instance.
|
48
|
+
diff = Gitlab::Git::Diff.new(raw)
|
49
|
+
|
50
|
+
# If a diff is too large we still want to display some information
|
51
|
+
# about it (e.g. the file path) without keeping the raw data around
|
52
|
+
# (as this would be a waste of memory usage).
|
53
|
+
#
|
54
|
+
# This also removes the line count (from the diff itself) so it
|
55
|
+
# doesn't add up to the total amount of lines.
|
56
|
+
if diff.too_large?
|
57
|
+
diff.prune_large_diff!
|
58
|
+
end
|
53
59
|
|
54
|
-
|
55
|
-
|
56
|
-
|
60
|
+
if !@all_diffs && !@no_collapse
|
61
|
+
if diff.collapsible? || over_safe_limits?(i)
|
62
|
+
diff.prune_collapsed_diff!
|
63
|
+
end
|
57
64
|
end
|
58
|
-
end
|
59
65
|
|
60
|
-
|
61
|
-
|
66
|
+
@line_count += diff.line_count
|
67
|
+
@byte_count += diff.diff.bytesize
|
62
68
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
+
if !@all_diffs && (@line_count >= @max_lines || @byte_count >= @max_bytes)
|
70
|
+
# This last Diff instance pushes us over the lines limit. We stop and
|
71
|
+
# discard it.
|
72
|
+
@overflow = true
|
73
|
+
break
|
74
|
+
end
|
69
75
|
|
70
|
-
|
76
|
+
yield @array[i] = diff
|
77
|
+
end
|
71
78
|
end
|
72
79
|
end
|
73
80
|
|
@@ -81,7 +88,7 @@ module Gitlab
|
|
81
88
|
end
|
82
89
|
|
83
90
|
def size
|
84
|
-
@size ||= count # forces a loop
|
91
|
+
@size ||= count # forces a loop using each method
|
85
92
|
end
|
86
93
|
|
87
94
|
def real_size
|
@@ -95,9 +102,11 @@ module Gitlab
|
|
95
102
|
end
|
96
103
|
|
97
104
|
def decorate!
|
98
|
-
each_with_index do |element, i|
|
105
|
+
collection = each_with_index do |element, i|
|
99
106
|
@array[i] = yield(element)
|
100
107
|
end
|
108
|
+
@populated = true
|
109
|
+
collection
|
101
110
|
end
|
102
111
|
|
103
112
|
private
|
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.4.
|
4
|
+
version: 10.4.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-07-
|
11
|
+
date: 2016-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: github-linguist
|
@@ -125,8 +125,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.5.1
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: Gitlab::Git library
|
132
132
|
test_files: []
|
133
|
+
has_rdoc:
|