Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "undefined local variable" error in update-report #14903

Merged
merged 2 commits into from
Mar 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Library/Homebrew/cmd/update-report.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true

require "migrator"
Expand Down Expand Up @@ -188,7 +188,7 @@ def output_update_report
begin
reporter = Reporter.new(tap)
rescue Reporter::ReporterRevisionUnsetError => e
onoe "#{e.message}\n#{e.backtrace.join "\n"}" if Homebrew::EnvConfig.developer?
onoe "#{e.message}\n#{e.backtrace&.join("\n")}" if Homebrew::EnvConfig.developer?
next
end
if reporter.updated?
Expand Down Expand Up @@ -315,7 +315,7 @@ def install_core_tap_if_necessary
return if CoreTap.instance.installed?

CoreTap.ensure_installed!
revision = core_tap.git_head
revision = CoreTap.instance.git_head
ENV["HOMEBREW_UPDATE_BEFORE_HOMEBREW_HOMEBREW_CORE"] = revision
ENV["HOMEBREW_UPDATE_AFTER_HOMEBREW_HOMEBREW_CORE"] = revision
end
Expand Down Expand Up @@ -496,7 +496,7 @@ def migrate_tap_migration
system HOMEBREW_BREW_FILE, "link", new_full_name, "--overwrite"
end
rescue Exception => e # rubocop:disable Lint/RescueException
onoe "#{e.message}\n#{e.backtrace.join "\n"}" if Homebrew::EnvConfig.developer?
onoe "#{e.message}\n#{e.backtrace&.join("\n")}" if Homebrew::EnvConfig.developer?
end
next
end
Expand Down Expand Up @@ -560,7 +560,7 @@ def migrate_formula_rename(force:, verbose:)
begin
f = Formulary.factory(new_full_name)
rescue Exception => e # rubocop:disable Lint/RescueException
onoe "#{e.message}\n#{e.backtrace.join "\n"}" if Homebrew::EnvConfig.developer?
onoe "#{e.message}\n#{e.backtrace&.join("\n")}" if Homebrew::EnvConfig.developer?
next
end

Expand Down Expand Up @@ -642,8 +642,8 @@ def dump(updated_formula_report: true)
dump_deleted_formula_report(report_all)
dump_deleted_cask_report(report_all)

outdated_formulae = nil
outdated_casks = nil
outdated_formulae = []
outdated_casks = []

if updated_formula_report && report_all
dump_modified_formula_report
Expand Down