diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-04-20 21:23:26 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-04-20 21:27:02 +0900 |
commit | 3cd3a507e336a81c7e00313b9effb80a8e596a6e (patch) | |
tree | d90df3d5546a1db6ef36f231cf3dd0d52ab1913c /tool | |
parent | aeb9d11594750eec085af60d6bee1ed86dd14686 (diff) |
[sync_default_gems.rb] Force reset conflict files to be ignored
[ci skip]
Diffstat (limited to 'tool')
-rw-r--r-- | tool/sync_default_gems.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index d034e723a4..4451a4ed48 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) 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 |