diff options
author | Soutaro Matsumoto <matsumoto@soutaro.com> | 2020-10-09 18:41:20 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-09 18:41:20 +0900 |
commit | 02e17d473a5edef69b8c03a8e2b91fdd0c27ed75 (patch) | |
tree | f0e015ff77cd978baacff88db9c146cfe7aa1e5a /tool | |
parent | 8d1b18886459d3f92cbaf6547f22f893a9a2ced1 (diff) | |
download | ruby-02e17d473a5edef69b8c03a8e2b91fdd0c27ed75.tar.gz |
Let bundled_gems specify commits to test (#3641)
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/fetch-bundled_gems.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tool/fetch-bundled_gems.rb b/tool/fetch-bundled_gems.rb index 4ba1848d00..ebb70e88f9 100755 --- a/tool/fetch-bundled_gems.rb +++ b/tool/fetch-bundled_gems.rb @@ -8,18 +8,20 @@ BEGIN { Dir.chdir(dir) } -n, v, u = $F +n, v, u, r = $F + +next if n =~ /^#/ if File.directory?(n) puts "updating #{n} ..." - system("git", (v == "master" ? "pull" : "fetch"), chdir: n) or abort + system("git", "fetch", chdir: n) or abort else puts "retrieving #{n} ..." system(*%W"git clone #{u} #{n}") or abort end +c = r || "v#{v}" checkout = %w"git -c advice.detachedHead=false checkout" -unless system(*checkout, v.sub(/\A(?=\d)/, 'v'), chdir: n) - unless /\A\d/ =~ v and system(*checkout, v, chdir: n) - abort - end +puts "checking out #{c} (v=#{v}, r=#{r}) ..." +unless system(*checkout, c, "--", chdir: n) + abort end |