Version::getShortVersion: handle "rev" being empty (#9502)

In which case we reply "unknown" instead of an empty string ;).
reviewable/pr9528/r1
hasezoey 2 years ago committed by GitHub
parent 61415a3723
commit c8d84ffc77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -55,6 +55,7 @@ end
function Version:getShortVersion()
if not self.short then
local rev = self:getCurrentRevision()
if (not rev or rev == "") then return "unknown" end
local year, month, point, revision = rev:match("v(%d%d%d%d)%.(%d%d)%.?(%d?%d?)-?(%d*)")
self.short = year .. "." .. month
if point and point ~= "" then

Loading…
Cancel
Save