From 31636bbddc4ac56fccdf09a815cf1915e4bec444 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Wed, 30 Sep 2020 12:39:18 +0200 Subject: Update to ruby/mspec@4120a62 --- spec/mspec/tool/sync/sync-rubyspec.rb | 27 ++++++++++++++++++--------- 1 file 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 -- cgit v1.2.3