summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-09-30 12:39:18 +0200
committerBenoit Daloze <eregontp@gmail.com>2020-09-30 12:39:18 +0200
commit31636bbddc4ac56fccdf09a815cf1915e4bec444 (patch)
treeff66faeaa6e76ecc1c7380eb8873611796c9ab29
parent201d50164016bc519041af302f47d92f314abac5 (diff)
Update to ruby/mspec@4120a62
-rw-r--r--spec/mspec/tool/sync/sync-rubyspec.rb27
1 files changed, 18 insertions, 9 deletions
diff --git a/spec/mspec/tool/sync/sync-rubyspec.rb b/spec/mspec/tool/sync/sync-rubyspec.rb
index 977bda3715..93e0f538ba 100644
--- a/spec/mspec/tool/sync/sync-rubyspec.rb
+++ b/spec/mspec/tool/sync/sync-rubyspec.rb
@@ -157,12 +157,16 @@ def rebase_commits(impl)
end
end
+def new_commits?(impl)
+ Dir.chdir(SOURCE_REPO) do
+ diff = `git diff master #{impl.rebased_branch}`
+ !diff.empty?
+ end
+end
+
def test_new_specs
require "yaml"
Dir.chdir(SOURCE_REPO) do
- diff = `git diff master`
- abort "#{BRIGHT_YELLOW}No new commits, aborting#{RESET}" if diff.empty?
-
workflow = YAML.load_file(".github/workflows/ci.yml")
job_name = MSPEC ? "test" : "specs"
versions = workflow.dig("jobs", job_name, "strategy", "matrix", "ruby")
@@ -195,8 +199,8 @@ end
def fast_forward_master(impl)
Dir.chdir(SOURCE_REPO) do
sh "git", "checkout", "master"
- sh "git", "merge", "--ff-only", "#{impl.name}-rebased"
- sh "git", "branch", "--delete", "#{impl.name}-rebased"
+ sh "git", "merge", "--ff-only", impl.rebased_branch
+ sh "git", "branch", "--delete", impl.rebased_branch
end
end
@@ -215,10 +219,15 @@ def main(impls)
update_repo(impl)
filter_commits(impl)
rebase_commits(impl)
- test_new_specs
- verify_commits(impl)
- fast_forward_master(impl)
- check_ci
+ if new_commits?(impl)
+ test_new_specs
+ verify_commits(impl)
+ fast_forward_master(impl)
+ check_ci
+ else
+ STDERR.puts "#{BRIGHT_YELLOW}No new commits#{RESET}"
+ fast_forward_master(impl)
+ end
end
end