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

[rubygems/rubygems] Remove unnecessary code

`@host` _could_ be `nil` at this point, but only if all the conditions
above for setting `@host` were `nil`. In that case, it is guaranteed
to `default_gem_server` metadata is `nil` since it's one of the
branches in that condition. So this code would just be setting an
already `nil` variable to `nil`. Hence, not needed.

https://github.com/rubygems/rubygems/commit/e3ccff3c5c
This commit is contained in:
Thomas McDonald 2020-04-28 17:37:59 +02:00 committed by Hiroshi SHIBATA
parent 12ac0fa939
commit 856f2f31ff
Notes: git 2020-05-08 14:14:25 +09:00

View file

@ -72,10 +72,6 @@ The push command will use ~/.gem/credentials to authenticate to a server, but yo
gem_data = Gem::Package.new(name)
unless @host
@host = gem_data.spec.metadata['default_gem_server']
end
push_host = nil
if gem_data.spec.metadata.has_key?('allowed_push_host')