releasinator 0.3.0 → 0.3.1
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/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/git_util.rb +7 -0
- data/lib/releasinator/version.rb +1 -1
- data/lib/validator.rb +18 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ca80fa1b94bf914563cddabb0af5cc27f303e6c
|
4
|
+
data.tar.gz: bb274205de083b495f5866fee842af743893f877
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3c601f92e61146619786ee59c89529346de11f34e982b09b72d79d4ed2c0879493b1ed156dce7a3e990a6ea268fd76d0d3bb028cdfbe7596cb127fe513d31de
|
7
|
+
data.tar.gz: 668e599c2cf6b6bc7f92d8da6cfe346be23a0dae850709166caede3bada910fe8377bf206cabb7947b69a9afa2611a15d2cd4cbfb8debcc5893601fc47ff7534
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
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
|
data/lib/releasinator/version.rb
CHANGED
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
|
-
|
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,"\
|