@@ 148,14 148,16 @@ local function go_modcache_info(filename)
return false
end
- if json.Origin.VCS ~= 'git' then
+ if not json.Origin or json.Origin.VCS ~= 'git' then
return false
end
local commit = json.Origin.Hash
- local match, _, tag = string.find(json.Origin.Ref, 'refs/tags/([^/]+)')
- if match then
- commit = tag
+ if json.Origin.Ref ~= nil then
+ local match, _, tag = string.find(json.Origin.Ref, 'refs/tags/([^/]+)')
+ if match then
+ commit = tag
+ end
end
local hostname = json.Origin.URL:match '://([^/]+)/'