1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

sync_default_gems.rb: remove un-committed files [ci skip]

As files non-existing in the repository cannot be checked out,
remove files to be ignored once, and re-check the status.
This commit is contained in:
Nobuyoshi Nakada 2021-03-28 23:39:27 +09:00
parent 36bad6f14f
commit f7faac13c6
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -436,6 +436,8 @@ def sync_default_gems_with_commits(gem, ranges, edit: nil)
ignore, conflict = result.partition {|name| IGNORE_FILE_PATTERN =~ name}
unless ignore.empty?
system(*%W"git reset HEAD --", *ignore)
File.unlink(*ignore)
ignore = IO.popen(%W"git status --porcelain" + ignore, &:readlines).map! {|line| line[/^.. (.*)/, 1]}
system(*%W"git checkout HEAD --", *ignore)
end
unless conflict.empty?