From 856f2f31ffebd070405821dd41fca9c67fd5cced Mon Sep 17 00:00:00 2001 From: Thomas McDonald Date: Tue, 28 Apr 2020 17:37:59 +0200 Subject: [PATCH] [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 --- lib/rubygems/commands/push_command.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/rubygems/commands/push_command.rb b/lib/rubygems/commands/push_command.rb index bdb92cbb42..0c121cb553 100644 --- a/lib/rubygems/commands/push_command.rb +++ b/lib/rubygems/commands/push_command.rb @@ -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')