[sync_default_gems.rb] Reset files to be ignored
[ci skip]
This commit is contained in:
parent
668c97b72c
commit
691a15ebc7
@ -348,9 +348,7 @@ def sync_default_gems_with_commits(gem, range)
|
|||||||
|
|
||||||
# Ignore Merge commit and insufficiency commit for ruby core repository.
|
# Ignore Merge commit and insufficiency commit for ruby core repository.
|
||||||
commits.delete_if do |sha, subject|
|
commits.delete_if do |sha, subject|
|
||||||
files = IO.popen(%W"git diff-tree --no-commit-id --name-only -r #{sha}") do |f|
|
files = IO.popen(%W"git diff-tree --no-commit-id --name-only -r #{sha}", &:readlines)
|
||||||
f.readlines
|
|
||||||
end
|
|
||||||
subject =~ /^Merge/ || subject =~ /^Auto Merge/ || files.all?{|file| file =~ IGNORE_FILE_PATTERN}
|
subject =~ /^Merge/ || subject =~ /^Auto Merge/ || files.all?{|file| file =~ IGNORE_FILE_PATTERN}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -375,12 +373,21 @@ def sync_default_gems_with_commits(gem, range)
|
|||||||
next if skipped
|
next if skipped
|
||||||
|
|
||||||
if result.empty?
|
if result.empty?
|
||||||
|
skipped = true
|
||||||
|
elsif result.start_with?("CONFLICT")
|
||||||
|
result = IO.popen(%W"git status --porcelain", &:readlines).each(&:chomp!)
|
||||||
|
ignore = result.map {|line| /^DU / =~ line and IGNORE_FILE_PATTERN =~ (name = $') and name}
|
||||||
|
ignore.compact!
|
||||||
|
system(*%W"git reset", *ignore) unless ignore.empty?
|
||||||
|
skipped = !system({"GIT_EDITOR"=>"true"}, *%W"git cherry-pick --no-edit --continue")
|
||||||
|
end
|
||||||
|
|
||||||
|
if skipped
|
||||||
failed_commits << sha
|
failed_commits << sha
|
||||||
`git reset` && `git checkout .` && `git clean -fd`
|
`git reset` && `git checkout .` && `git clean -fd`
|
||||||
skipped = true
|
|
||||||
puts "Failed to pick #{sha}"
|
puts "Failed to pick #{sha}"
|
||||||
|
next
|
||||||
end
|
end
|
||||||
next if skipped
|
|
||||||
|
|
||||||
puts "Update commit message: #{sha}"
|
puts "Update commit message: #{sha}"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user