Don't require "branch: main" for resources with revisions set

Just like when a tag is set, when a revision is set for a resource it shouldn't _also_ specify that it comes from the main branch.
This commit is contained in:
Natalie Weizenbaum 2024-02-08 23:54:12 +00:00 committed by GitHub
parent a92591108d
commit da624b2f3c
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