tap-info cmd: skip untapped core taps

When homebrew/core or homebrew/cask are untapped `brew tap-info` fails because
Tap.each includes them and tap.private? fails without a git repo interrogate.

This restores the behavior of `brew tap-info` before #16710
This commit is contained in:
Ryan Rotter 2024-03-29 21:52:42 -04:00
parent 02a0ea8449
commit d856d88c17
2 changed files with 8 additions and 1 deletions

View File

@ -48,7 +48,7 @@ module Homebrew
formula_count = 0
command_count = 0
private_count = 0
Tap.each do |tap|
Tap.installed.each do |tap|
tap_count += 1
formula_count += tap.formula_files.size
command_count += tap.command_files.size

View File

@ -13,4 +13,11 @@ RSpec.describe "brew tap-info" do
.and not_to_output.to_stderr
.and be_a_success
end
it "display brief statistics for all installed taps", :integration_test, :needs_network do
expect { brew "tap-info", "HOMEBREW_NO_INSTALL_FROM_API" => nil }
.to output(/\d+ taps?, \d+ private/).to_stdout
.and not_to_output.to_stderr
.and be_a_success
end
end