未验证 提交 d1295ae4 编辑于 作者: Jonathan Chang's avatar Jonathan Chang 提交者: GitHub
浏览文件

Merge pull request #9305 from jonchang/check-tap-branches

diagnostic: check all tap branches, not just core
......@@ -566,20 +566,30 @@ module Homebrew
examine_git_origin(cask_tap.path, cask_tap.remote)
end
def check_coretap_git_branch
sig { returns(T.nilable(String)) }
def check_tap_git_branch
return if ENV["CI"]
return unless Utils::Git.available?
coretap_path = CoreTap.instance.path
return if !Utils::Git.available? || !(coretap_path/".git").exist?
commands = Tap.map do |tap|
next unless tap.path.git?
next if tap.path.git_origin.blank?
branch = coretap_path.git_branch
return if branch.blank? || branch.include?("master")
branch = tap.path.git_branch
next if branch.blank?
<<~EOS
#{CoreTap.instance.full_name} is not on the master branch.
origin_branch = Utils::Git.origin_branch(tap.path)&.split("/")&.last
next if origin_branch == branch
"git -C $(brew --repo #{tap.name}) checkout #{origin_branch}"
end.compact
Check out the master branch by running:
git -C "$(brew --repo homebrew/core)" checkout master
return if commands.blank?
<<~EOS
Some taps are not on the default git origin branch and may not receive
updates. If this is a surprise to you, check out the default branch with:
#{commands.join("\n ")}
EOS
end
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册