diff options
Diffstat (limited to 'tool/sync_default_gems.rb')
-rwxr-xr-x | tool/sync_default_gems.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index 9b9b0011ba..ce6a6dd0ae 100755 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -558,16 +558,15 @@ module SyncDefaultGems puts "Pick #{sha} from #{repo}." # Attempt to cherry-pick a commit - skipped = false result = IO.popen(%W"git cherry-pick #{sha}", &:read) if result =~ /nothing\ to\ commit/ `git reset` - skipped = true puts "Skip empty commit #{sha}" + next end - next if skipped # Skip empty commits or deal with conflicts + skipped = false if result.empty? skipped = true elsif /^CONFLICT/ =~ result @@ -585,6 +584,7 @@ module SyncDefaultGems end ignored_paths.each do |path| if File.exist?(path) + puts "Removing: #{path}" system("git", "reset", path) rm_rf(path) end @@ -609,6 +609,12 @@ module SyncDefaultGems # UA: unmerged, added by them # AA: unmerged, both added unmerged = pipe_readlines(%W"git status --porcelain -z") + if unmerged.empty? + # Everything was removed as `ignored_paths`. Skip this commit. + `git reset` && `git checkout .` && `git clean -fd` + puts "Skip empty commit #{sha}" + next + end # For YARP, we want to handle DD: deleted by both. if gem == "yarp" |