gitlab_git 6.0.1 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/gitlab_git/compare.rb +9 -16
- 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: 7fec172f5cc14c01795fd4c012747ddfe6b761a9
|
4
|
+
data.tar.gz: 57960c2f1efd07b8bc3e41e16a5b9e9094e2a5ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8c347575f7028053bd084adcaba8edd76464e76bdb00f581d0bd1f03cee7a11db79baa67f5384c91e3475f06173fddb9bbe8966aa48870d12e9d4d9f619dd9d
|
7
|
+
data.tar.gz: 97b92cb7270546ececaba72b3a1ecccea887a94993fa895069f8032aa8dd5b4a54941d2821f1266fe829e3756428b4f190da8503b6518ed38c686a91c349326f
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.0
|
1
|
+
6.1.0
|
data/lib/gitlab_git/compare.rb
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
module Gitlab
|
2
2
|
module Git
|
3
3
|
class Compare
|
4
|
-
|
4
|
+
attr_reader :commits, :diffs, :same, :timeout, :head, :base
|
5
5
|
|
6
|
-
def initialize(repository,
|
6
|
+
def initialize(repository, base, head)
|
7
7
|
@commits, @diffs = [], []
|
8
|
-
@commit = nil
|
9
8
|
@same = false
|
10
|
-
@limit = limit
|
11
9
|
@repository = repository
|
12
10
|
@timeout = false
|
13
11
|
|
14
|
-
return unless
|
12
|
+
return unless base && head
|
15
13
|
|
16
|
-
@base = Gitlab::Git::Commit.find(repository,
|
17
|
-
@head = Gitlab::Git::Commit.find(repository,
|
14
|
+
@base = Gitlab::Git::Commit.find(repository, base.try(:strip))
|
15
|
+
@head = Gitlab::Git::Commit.find(repository, head.try(:strip))
|
18
16
|
|
19
17
|
return unless @base && @head
|
20
18
|
|
@@ -23,14 +21,13 @@ module Gitlab
|
|
23
21
|
return
|
24
22
|
end
|
25
23
|
|
26
|
-
@commit = @head
|
27
24
|
@commits = Gitlab::Git::Commit.between(repository, @base.id, @head.id)
|
28
25
|
end
|
29
26
|
|
30
27
|
def diffs(paths = nil)
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
unless @head && @base
|
29
|
+
return []
|
30
|
+
end
|
34
31
|
|
35
32
|
# Try to collect diff only if diffs is empty
|
36
33
|
# Otherwise return cached version
|
@@ -49,11 +46,7 @@ module Gitlab
|
|
49
46
|
# Check if diff is empty because it is actually empty
|
50
47
|
# and not because its impossible to get it
|
51
48
|
def empty_diff?
|
52
|
-
diffs.empty? && timeout == false
|
53
|
-
end
|
54
|
-
|
55
|
-
def commits_over_limit?
|
56
|
-
commits.size > limit
|
49
|
+
diffs.empty? && timeout == false
|
57
50
|
end
|
58
51
|
end
|
59
52
|
end
|
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: 6.0
|
4
|
+
version: 6.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitriy Zaporozhets
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitlab-linguist
|