Skip to content

Commit

Permalink
[rubygems/rubygems] Remove unnecessary code
Browse files Browse the repository at this point in the history
`@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.

rubygems/rubygems@e3ccff3c5c
  • Loading branch information
thomas-mcdonald authored and hsbt committed May 8, 2020
1 parent 12ac0fa commit 856f2f3
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/rubygems/commands/push_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ def send_gem(name)

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')
Expand Down

0 comments on commit 856f2f3

Please sign in to comment.