ruby-changes:63215
From: Benoit <ko1@a...>
Date: Wed, 30 Sep 2020 19:40:17 +0900 (JST)
Subject: [ruby-changes:63215] 31636bbddc (master): Update to ruby/mspec@4120a62
https://git.ruby-lang.org/ruby.git/commit/?id=31636bbddc From 31636bbddc4ac56fccdf09a815cf1915e4bec444 Mon Sep 17 00:00:00 2001 From: Benoit Daloze <eregontp@g...> Date: Wed, 30 Sep 2020 12:39:18 +0200 Subject: Update to ruby/mspec@4120a62 diff --git a/spec/mspec/tool/sync/sync-rubyspec.rb b/spec/mspec/tool/sync/sync-rubyspec.rb index 977bda3..93e0f53 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) https://github.com/ruby/ruby/blob/trunk/spec/mspec/tool/sync/sync-rubyspec.rb#L157 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 https://github.com/ruby/ruby/blob/trunk/spec/mspec/tool/sync/sync-rubyspec.rb#L199 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) https://github.com/ruby/ruby/blob/trunk/spec/mspec/tool/sync/sync-rubyspec.rb#L219 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 v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/