diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index 47d0b44d01b3b..670a4250930cd 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -325,8 +325,10 @@ def downloads end def fetch_downloadable(downloadable) - tries = args.retry? ? {} : { tries: 1 } - downloads[downloadable] ||= download_queue.enqueue(RetryableDownload.new(downloadable, **tries), force: args.force?) + downloads[downloadable] ||= begin + tries = args.retry? ? {} : { tries: 1 } + download_queue.enqueue(RetryableDownload.new(downloadable, **tries), force: args.force?) + end end end end