Fix version reporting in odebug messages

This commit is contained in:
Anatoli Babenia 2025-06-19 16:18:41 +03:00
parent 2cd7a32660
commit cf2e20d586

View File

@ -63,12 +63,12 @@ module Homebrew
@name = T.let(name, String) @name = T.let(name, String)
@head = head @head = head
version = if version.present? if version.present?
version = Version.new(version)
odebug "version from user: #{version}" odebug "version from user: #{version}"
Version.new(version)
else else
version = Version.detect(url)
odebug "version from url: #{version}" odebug "version from url: #{version}"
Version.detect(url)
end end
if fetch && user && repository if fetch && user && repository
@ -78,10 +78,9 @@ module Homebrew
begin begin
latest_release = GitHub.get_latest_release(user, repository) latest_release = GitHub.get_latest_release(user, repository)
version = Version.new(latest_release.fetch("tag_name")) version = Version.new(latest_release.fetch("tag_name"))
odebug "github: version from latest_release: #{@version}" odebug "github: version from latest_release: #{version}"
rescue GitHub::API::HTTPNotFoundError rescue GitHub::API::HTTPNotFoundError
odebug "github: latest_release lookup failed: #{url}" odebug "github: latest_release lookup failed: #{url}"
nil
end end
end end
end end