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

fetch-bundled_gems.rb: Quiet detached HEAD advice

This commit is contained in:
Nobuyoshi Nakada 2020-04-25 13:16:40 +09:00
parent c2700379ad
commit f12f9f511d
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -17,8 +17,9 @@ else
puts "retrieving #{n} ..."
system(*%W"git clone #{u} #{n}") or abort
end
unless system(*%W"git checkout #{v.sub(/\A(?=\d)/, 'v')}", chdir: n)
unless /\A\d/ =~ v and system(*%W"git checkout #{v}", chdir: n)
checkout = %w"git checkout -c advice.detachedHead=false"
unless system(*checkout, v.sub(/\A(?=\d)/, 'v'), chdir: n)
unless /\A\d/ =~ v and system(*checkout, v, chdir: n)
abort
end
end