gitlab_git 6.0.1 → 6.1.0

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/gitlab_git/compare.rb +9 -16
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50120b4f1056d8df68e3dc4329dfd8a0518cf9c9
4
- data.tar.gz: eec963ccfdf12d379af1c3a20f57f2578df88ad2
3
+ metadata.gz: 7fec172f5cc14c01795fd4c012747ddfe6b761a9
4
+ data.tar.gz: 57960c2f1efd07b8bc3e41e16a5b9e9094e2a5ce
5
5
  SHA512:
6
- metadata.gz: 34f2c7a605650d5e1393c1c359fa1944ee68d752bcc7230023134f3c2272dd0d3da90be6e4dd2d0542b65fc9d4bdbbbcca186337f007d0c3cc4cde5404bfc6e8
7
- data.tar.gz: ee25fdcaa3dafcf58ad48c72dee6fb9b3747b54e5911b453c96a9528c5e575f0a5b4e4134edbb109f810021e993ad53d2a83ae3847143cf5e8a4857efb8289f2
6
+ metadata.gz: c8c347575f7028053bd084adcaba8edd76464e76bdb00f581d0bd1f03cee7a11db79baa67f5384c91e3475f06173fddb9bbe8966aa48870d12e9d4d9f619dd9d
7
+ data.tar.gz: 97b92cb7270546ececaba72b3a1ecccea887a94993fa895069f8032aa8dd5b4a54941d2821f1266fe829e3756428b4f190da8503b6518ed38c686a91c349326f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.0.1
1
+ 6.1.0
@@ -1,20 +1,18 @@
1
1
  module Gitlab
2
2
  module Git
3
3
  class Compare
4
- attr_accessor :commits, :commit, :diffs, :same, :limit, :timeout
4
+ attr_reader :commits, :diffs, :same, :timeout, :head, :base
5
5
 
6
- def initialize(repository, from, to, limit = 100)
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 from && to
12
+ return unless base && head
15
13
 
16
- @base = Gitlab::Git::Commit.find(repository, from.try(:strip))
17
- @head = Gitlab::Git::Commit.find(repository, to.try(:strip))
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
- # Return empty array if amount of commits
32
- # more than specified limit
33
- return [] if commits_over_limit?
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 && commits.size < limit
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.1
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-08 00:00:00.000000000 Z
11
+ date: 2014-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab-linguist