Merge pull request #14359 from gromgit/check-brew-branch
show/check Homebrew branch
This commit is contained in:
commit
3be6350402
@ -519,6 +519,17 @@ module Homebrew
|
||||
examine_git_origin(repo, Homebrew::EnvConfig.brew_git_remote)
|
||||
end
|
||||
|
||||
def check_brew_git_branch
|
||||
repo = HOMEBREW_REPOSITORY.dup.extend(GitRepositoryExtension)
|
||||
return if repo.git_default_origin_branch?
|
||||
|
||||
<<~EOS
|
||||
Homebrew is 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:
|
||||
git -C $(brew --repo) checkout #{repo.git_origin_branch}"
|
||||
EOS
|
||||
end
|
||||
|
||||
def check_coretap_integrity
|
||||
coretap = CoreTap.instance
|
||||
unless coretap.installed?
|
||||
|
||||
@ -52,6 +52,11 @@ module SystemConfig
|
||||
homebrew_repo.git_origin || "(none)"
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
def branch
|
||||
homebrew_repo.git_branch || "(none)"
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
def core_tap_head
|
||||
CoreTap.instance.git_head || "(none)"
|
||||
@ -155,6 +160,7 @@ module SystemConfig
|
||||
f.puts "ORIGIN: #{origin}"
|
||||
f.puts "HEAD: #{head}"
|
||||
f.puts "Last commit: #{last_commit}"
|
||||
f.puts "Branch: #{branch}"
|
||||
end
|
||||
|
||||
def homebrew_env_config(f = $stdout)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user