Merge pull request #14011 from samford/resource_auditor-fix-audit_head_branch-error

ResourceAuditor: Fix #audit_head_branch error
This commit is contained in:
Sam Ford 2022-10-18 23:15:11 -04:00 committed by GitHub
commit 95364610cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,9 +146,8 @@ module Homebrew
return if specs[:tag].present?
branch = Utils.popen_read("git", "ls-remote", "--symref", url, "HEAD")
.match(%r{ref: refs/heads/(.*?)\s+HEAD})[1]
return if branch == specs[:branch]
.match(%r{ref: refs/heads/(.*?)\s+HEAD})&.to_a&.second
return if branch.blank? || branch == specs[:branch]
problem "Use `branch: \"#{branch}\"` to specify the default branch"
end