mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
Attempt to recover from YARP sync failures
This commit is contained in:
parent
7a2aeadb78
commit
6a6dacb0d1
1 changed files with 15 additions and 4 deletions
|
@ -571,19 +571,30 @@ module SyncDefaultGems
|
||||||
if result.empty?
|
if result.empty?
|
||||||
skipped = true
|
skipped = true
|
||||||
elsif /^CONFLICT/ =~ result
|
elsif /^CONFLICT/ =~ result
|
||||||
# Automatically fix some parts of conflicts
|
# Forcibly remove any files that we don't want to copy to this repository.
|
||||||
|
# We also ignore them as new `toplevels` even when they don't conflict.
|
||||||
case gem
|
case gem
|
||||||
when "rubygems"
|
when "rubygems"
|
||||||
# git doesn't auto-rename new files under the vcr_cassettes to spec/bundler.
|
# We don't copy any vcr_cassettes to this repository. Because the directory does not
|
||||||
# We delete them as `toplevels` if they don't conflict.
|
# exist, rename detection doesn't work. So it starts with the original path `bundler/`.
|
||||||
%w[bundler/spec/support/artifice/vcr_cassettes].each do |rem|
|
%w[bundler/spec/support/artifice/vcr_cassettes].each do |rem|
|
||||||
if File.exist?(rem)
|
if File.exist?(rem)
|
||||||
system("git", "reset", rem)
|
system("git", "reset", rem)
|
||||||
rm_rf(rem)
|
rm_rf(rem)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# New files renamed to spec/bundler are safe to commit.
|
end
|
||||||
|
|
||||||
|
# git has inexact rename detection, so they follow directory renames even for new files.
|
||||||
|
# However, new files are considered a `CONFLICT (file location)`, so you need to git-add them here.
|
||||||
|
# We hope that they are not other kinds of conflicts, assuming we don't modify them in this repository.
|
||||||
|
case gem
|
||||||
|
when "rubygems"
|
||||||
system(*%w[git add spec/bundler])
|
system(*%w[git add spec/bundler])
|
||||||
|
when "yarp"
|
||||||
|
system(*%w[git add lib/yarp])
|
||||||
|
system(*%w[git add test/yarp])
|
||||||
|
system(*%w[git add yarp])
|
||||||
end
|
end
|
||||||
|
|
||||||
# Discover unmerged files
|
# Discover unmerged files
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue