ruby-changes:60840
From: Nobuyoshi <ko1@a...>
Date: Mon, 20 Apr 2020 21:27:31 +0900 (JST)
Subject: [ruby-changes:60840] 3cd3a507e3 (master): [sync_default_gems.rb] Force reset conflict files to be ignored
https://git.ruby-lang.org/ruby.git/commit/?id=3cd3a507e3 From 3cd3a507e336a81c7e00313b9effb80a8e596a6e Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Mon, 20 Apr 2020 21:23:26 +0900 Subject: [sync_default_gems.rb] Force reset conflict files to be ignored [ci skip] diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index d034e72..4451a4e 100644 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -374,11 +374,14 @@ def sync_default_gems_with_commits(gem, range) https://github.com/ruby/ruby/blob/trunk/tool/sync_default_gems.rb#L374 if result.empty? skipped = true - elsif result.start_with?("CONFLICT") + elsif /^CONFLICT/ =~ result result = IO.popen(%W"git status --porcelain", &:readlines).each(&:chomp!) - ignore = result.map {|line| /^DU / =~ line and IGNORE_FILE_PATTERN =~ (name = $') and name} + ignore = result.map {|line| /^.U / =~ line and IGNORE_FILE_PATTERN =~ (name = $') and name} ignore.compact! - system(*%W"git reset", *ignore) unless ignore.empty? + unless ignore.empty? + system(*%W"git reset HEAD --", *ignore) + system(*%W"git checkout HEAD --", *ignore) + end skipped = !system({"GIT_EDITOR"=>"true"}, *%W"git cherry-pick --no-edit --continue") end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/