summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-03-28 23:39:27 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-03-28 23:39:27 +0900
commitf7faac13c6f7776cbdc20d8f59e33d26e30b93d0 (patch)
tree64c10f0f7018fc04d62c564246caebc85c345332
parent36bad6f14f30db59f2d51e2acbdd9143230b35c5 (diff)
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.
-rw-r--r--tool/sync_default_gems.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 540a052..5b64c83 100644
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -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?