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: do not reset the whole directory [ci skip]

If no files to be ignored, resetting with no argument means
resetting the whole directory.
This commit is contained in:
Nobuyoshi Nakada 2021-04-08 12:04:25 +09:00
parent cdc0cdc77f
commit 956056db37
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -439,7 +439,7 @@ def sync_default_gems_with_commits(gem, ranges, edit: nil)
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)
system(*%W"git checkout HEAD --", *ignore) unless ignore.empty?
end
unless conflict.empty?
if edit