summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2025-11-05 15:11:05 +0900
committerKazuki Yamaguchi <k.github.xq3nw23egf7xvpit@rhe.jp>2025-11-05 02:35:48 -0800
commit946d2d036faee1eb1e37cb4c2bcad9feff9b5780 (patch)
tree1395e5238e2043aada7335a69d522b4ea0775b9b
parentae7415c27ec08dfc74346e6bf0ffc2e4636332c2 (diff)
Suppressing unused warnings
-rwxr-xr-xtool/sync_default_gems.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 03f9625bfa..b2509f0062 100755
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -381,7 +381,7 @@ module SyncDefaultGems
end
porcelain_status().each do |line|
- /\A(?<x>.)(?<y>.) (?<path>.*)\z/ =~ line or raise
+ /\A(?:.)(?:.) (?<path>.*)\z/ =~ line or raise
if config.excluded?(path)
puts "Restoring excluded file: #{path}"
IO.popen(%W"git checkout --" + [path], "rb", &:read)
@@ -553,7 +553,7 @@ module SyncDefaultGems
end
def collect_cacheinfo(tree)
- cacheinfo = pipe_readlines(%W"git ls-tree -r -t -z #{tree}").filter_map do |line|
+ pipe_readlines(%W"git ls-tree -r -t -z #{tree}").filter_map do |line|
fields, path = line.split("\t", 2)
mode, type, object = fields.split(" ", 3)
next unless type == "blob"
@@ -640,12 +640,11 @@ module SyncDefaultGems
end
def rewrite_commit(gem, sha)
- config = REPOSITORIES[gem]
author, message = make_commit_info(gem, sha)
new_blobs = collect_cacheinfo("#{sha}")
new_rewritten, new_ignored = rewrite_cacheinfo(gem, new_blobs)
- headers, orig_message = IO.popen(%W[git cat-file commit #{sha}], "rb", &:read).split("\n\n", 2)
+ headers, _ = IO.popen(%W[git cat-file commit #{sha}], "rb", &:read).split("\n\n", 2)
first_parent = headers[/^parent (.{40})$/, 1]
unless first_parent
# Root commit, first time to sync this repo
@@ -674,8 +673,6 @@ module SyncDefaultGems
end
def pickup_commit(gem, sha, edit)
- config = REPOSITORIES[gem]
-
rewritten = rewrite_commit(gem, sha)
# No changes remaining after rewriting