Skip to content

Commit

Permalink
[sync_default_gems.rb] Force reset conflict files to be ignored
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
nobu committed Apr 20, 2020
1 parent aeb9d11 commit 3cd3a50
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tool/sync_default_gems.rb
Expand Up @@ -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

Expand Down

0 comments on commit 3cd3a50

Please sign in to comment.