releasinator 0.3.0 → 0.3.1

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: 142b9a1c28929a601de19ffd0cbf8a9676c787b7
4
- data.tar.gz: 2db14160b8162e371cb3490e972c8c0a7d2f3782
3
+ metadata.gz: 6ca80fa1b94bf914563cddabb0af5cc27f303e6c
4
+ data.tar.gz: bb274205de083b495f5866fee842af743893f877
5
5
  SHA512:
6
- metadata.gz: e8e8f8e57c25244bc78e3bdbe23df9c33e1c54c2f64f2139cce64aecb9a3697df99245c8ef06cf71429f9af35dc41fe81d6cfcc581156c8dc3b1f8ab1ef88805
7
- data.tar.gz: ad2d9f1ed2ad1487443486446d3c85dc5cb368a64884aacf67779e8d4c51bb8e57f0f3c9ff1cf5a8722f47957a9c58955c94310c003d6d9a89a7993da51b6f68
6
+ metadata.gz: b3c601f92e61146619786ee59c89529346de11f34e982b09b72d79d4ed2c0879493b1ed156dce7a3e990a6ea268fd76d0d3bb028cdfbe7596cb127fe513d31de
7
+ data.tar.gz: 668e599c2cf6b6bc7f92d8da6cfe346be23a0dae850709166caede3bada910fe8377bf206cabb7947b69a9afa2611a15d2cd4cbfb8debcc5893601fc47ff7534
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  Releasinator release notes
2
2
  ==========================
3
3
 
4
+ 0.3.1
5
+ -----
6
+ * Fix regressed submodule origin/master validation to work properly with detached branches.
7
+
4
8
  0.3.0
5
9
  -----
6
10
  * Add new `validate:releasinator_version` task.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- releasinator (0.3.0)
4
+ releasinator (0.3.1)
5
5
  colorize (~> 0.7)
6
6
  configatron (~> 4.5)
7
7
  json (~> 1.8)
data/lib/git_util.rb CHANGED
@@ -35,6 +35,10 @@ module Releasinator
35
35
  CommandProcessor.command("git symbolic-ref --short HEAD").strip
36
36
  end
37
37
 
38
+ def self.detached?
39
+ "" == CommandProcessor.command("git symbolic-ref --short -q HEAD | cat").strip
40
+ end
41
+
38
42
  def self.untracked_files
39
43
  CommandProcessor.command("git ls-files --others --exclude-standard")
40
44
  end
@@ -80,6 +84,9 @@ module Releasinator
80
84
  end
81
85
  end
82
86
 
87
+ def self.get_local_head_sha1
88
+ CommandProcessor.command("git rev-parse --verify head").strip
89
+ end
83
90
 
84
91
  def self.get_local_branch_sha1(branch_name)
85
92
  CommandProcessor.command("git rev-parse --verify #{branch_name}").strip
@@ -1,3 +1,3 @@
1
1
  module Releasinator
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
data/lib/validator.rb CHANGED
@@ -273,7 +273,23 @@ module Releasinator
273
273
  Printer.success("Found " + submodules.count.to_s.bold + " submodules in .gitmodules.")
274
274
  submodules.each do |submodule|
275
275
  Dir.chdir(submodule.path) do
276
- validate_local_matches_remote("master")
276
+ if GitUtil.detached?
277
+ local_sha1 = GitUtil.get_local_head_sha1()
278
+ else
279
+ local_branch_name = GitUtil.get_current_branch
280
+ local_sha1 = GitUtil.get_local_branch_sha1(local_branch_name)
281
+ end
282
+
283
+ origin_master_sha1 = GitUtil.get_remote_branch_sha1("master")
284
+
285
+ if local_sha1 != origin_master_sha1
286
+ abort_string = "Submodule #{Dir.pwd} not on latest master. Currently at #{local_sha1}, but origin/master is at #{origin_master_sha1}."\
287
+ "\nYou should update this submodule to the latest in origin/master."
288
+ Printer.fail(abort_string)
289
+ abort()
290
+ else
291
+ Printer.success("Submodule #{Dir.pwd} matches origin/master.")
292
+ end
277
293
  validate_clean_git()
278
294
  end
279
295
  end
@@ -312,7 +328,7 @@ module Releasinator
312
328
  local_branch_sha1 = GitUtil.get_local_branch_sha1(branch_name)
313
329
  origin_branch_sha1 = GitUtil.get_remote_branch_sha1(branch_name)
314
330
  if local_branch_sha1 != origin_branch_sha1
315
- abort_string = "Branches not in sync: #{Dir.pwd} at #{local_branch_sha1}, but origin/#{branch_name} is #{origin_branch_sha1}."\
331
+ abort_string = "Branches not in sync: #{Dir.pwd} branch:#{branch_name} at #{local_branch_sha1}, but origin/#{branch_name} is at #{origin_branch_sha1}."\
316
332
  "\nIf you received this error on the root project, you may need to:"\
317
333
  "\n 1. pull the latest changes from the remote,"\
318
334
  "\n 2. push changes up to the remote,"\
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: releasinator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - PayPal