danger 5.5.1 → 5.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3969d079a0bc7fa36bf0bbd34507fc30f10905a
4
- data.tar.gz: c6145bb55ca215eb2025461e631b2ff2227ad6bf
3
+ metadata.gz: 336ff138e13d844d9c929f28ddea10a1a5a580a4
4
+ data.tar.gz: 359ee0f4fd27a7e7bf76ae43f20ee0433b8d6056
5
5
  SHA512:
6
- metadata.gz: 9bc5b3443fcf563e37e889c624ba6cced9b8f932c066ad13703df308015dcd4391a57aba1970e10a7631b3b71e550e5163a23beeea54cee3d7a56d1faeec5383
7
- data.tar.gz: f9e6ef5df4f3e927489c06c1c442273c1708e9be4889060889f5314a6941b21522f2372f9371a5dc956babeb98655ed647e46ef58e7ad3e3543a643813de971e
6
+ metadata.gz: 512935e983933356dfc82a642a878a665c7163c1461c95108444a59b5cdefc38b3a0bc6f089df4465d357c66536e7020de960a2d7390faf5f46957f66efd17ff
7
+ data.tar.gz: '0682177cce8bce5ce8109fd686f9329196758e98c674e79506b78eab71cc26a8ee7df03f479b310f7b65e93e996145cd6fab4643d1927c61cd23028246f1e1cc'
@@ -38,8 +38,8 @@ module Danger
38
38
  client = RequestSources::GitLab.new(nil, env).client
39
39
 
40
40
  merge_requests = client.merge_requests(project_id, state: :opened)
41
- merge_request = merge_requests.auto_paginate.bsearch do |mr|
42
- mr.sha >= base_commit
41
+ merge_request = merge_requests.auto_paginate.find do |mr|
42
+ mr.sha == base_commit
43
43
  end
44
44
 
45
45
  merge_request.nil? ? 0 : merge_request.iid
@@ -58,8 +58,12 @@ module Danger
58
58
  end
59
59
 
60
60
  def base_commit
61
- first_commit_in_branch = self.commits_json.last.id
62
- @base_commit ||= self.scm.exec "rev-parse #{first_commit_in_branch}^1"
61
+ if self.commits_json.last
62
+ first_commit_in_branch = self.commits_json.last.id
63
+ @base_commit ||= self.scm.exec "rev-parse #{first_commit_in_branch}^1"
64
+ else
65
+ @base_commit = ""
66
+ end
63
67
  end
64
68
 
65
69
  def mr_comments
@@ -78,6 +82,7 @@ module Danger
78
82
  end
79
83
 
80
84
  def setup_danger_branches
85
+ raise "Are you running `danger local/pr` against the correct repository? Also this can happen if you run danger on MR without changes" if base_commit.empty?
81
86
  base_branch = self.mr_json.source_branch
82
87
  head_branch = self.mr_json.target_branch
83
88
  head_commit = self.scm.head_commit
@@ -1,4 +1,4 @@
1
1
  module Danger
2
- VERSION = "5.5.1".freeze
2
+ VERSION = "5.5.2".freeze
3
3
  DESCRIPTION = "Like Unit Tests, but for your Team Culture.".freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.1
4
+ version: 5.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orta Therox
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-29 00:00:00.000000000 Z
12
+ date: 2017-10-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: claide
@@ -487,7 +487,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
487
487
  version: '0'
488
488
  requirements: []
489
489
  rubyforge_project:
490
- rubygems_version: 2.2.2
490
+ rubygems_version: 2.6.8
491
491
  signing_key:
492
492
  specification_version: 4
493
493
  summary: Like Unit Tests, but for your Team Culture.