Merge pull request #16626 from nex3/patch-1

Don't require "branch: main" for resources with revisions set
This commit is contained in:
Markus Reiter 2024-02-09 02:02:47 +01:00 committed by GitHub
commit 14763c9a7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -171,6 +171,7 @@ module Homebrew
return if spec_name != :head
return unless Utils::Git.remote_exists?(url)
return if specs[:tag].present?
return if specs[:revision].present?
branch = Utils.popen_read("git", "ls-remote", "--symref", url, "HEAD")
.match(%r{ref: refs/heads/(.*?)\s+HEAD})&.to_a&.second