Merge pull request #18464 from benknoble/bk/tap-info-commit

feat(tap-info): display Git information about non-Core/non-API taps
This commit is contained in:
Mike McQuaid 2024-10-01 09:25:44 +01:00 committed by GitHub
commit 54d484d428
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View File

@ -76,6 +76,10 @@ module Homebrew
info += "\nPrivate" if tap.private?
info += "\n#{tap.path} (#{tap.path.abv})"
info += "\nFrom: #{tap.remote.presence || "N/A"}"
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"
else
info += "Not installed"
end

View File

@ -902,6 +902,9 @@ class Tap
hash["remote"] = remote
hash["custom_remote"] = custom_remote?
hash["private"] = private?
hash["HEAD"] = git_head || "(none)"
hash["last_commit"] = git_last_commit || "never"
hash["branch"] = git_branch || "(none)"
end
hash