Merge pull request #20098 from Homebrew/hide_main_branches
Hide `main` branches from `brew tap-info` and `brew info`
This commit is contained in:
commit
dfd0cc8d85
@ -63,6 +63,8 @@ module Homebrew
|
||||
puts info
|
||||
else
|
||||
info = ""
|
||||
default_branches = %w[main master].freeze
|
||||
|
||||
taps.each_with_index do |tap, i|
|
||||
puts unless i.zero?
|
||||
info = "#{tap}: "
|
||||
@ -79,7 +81,7 @@ module Homebrew
|
||||
info += "\norigin: #{tap.remote}" if tap.remote != tap.default_remote
|
||||
info += "\nHEAD: #{tap.git_head || "(none)"}"
|
||||
info += "\nlast commit: #{tap.git_last_commit || "never"}"
|
||||
info += "\nbranch: #{tap.git_branch || "(none)"}" if tap.git_branch != "master"
|
||||
info += "\nbranch: #{tap.git_branch || "(none)"}" if default_branches.exclude?(tap.git_branch)
|
||||
else
|
||||
info += "Not installed"
|
||||
end
|
||||
|
||||
@ -128,7 +128,8 @@ module SystemConfig
|
||||
out.puts "#{tap_name} origin: #{tap.remote}" if tap.remote != tap.default_remote
|
||||
out.puts "#{tap_name} HEAD: #{tap.git_head || "(none)"}"
|
||||
out.puts "#{tap_name} last commit: #{tap.git_last_commit || "never"}"
|
||||
out.puts "#{tap_name} branch: #{tap.git_branch || "(none)"}" if tap.git_branch != "master"
|
||||
default_branches = %w[main master].freeze
|
||||
out.puts "#{tap_name} branch: #{tap.git_branch || "(none)"}" if default_branches.exclude?(tap.git_branch)
|
||||
end
|
||||
|
||||
if (json_file = Homebrew::API::HOMEBREW_CACHE_API/json_file_name) && json_file.exist?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user