internal/build: include git-date on detached head

This commit is contained in:
Martin Holst Swende 2024-08-19 08:58:45 +02:00
parent 710c3f32ac
commit 0e6066ee17
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -111,6 +111,7 @@ func LocalEnv() Environment {
commitRe, _ := regexp.Compile("^([0-9a-f]{40})$") commitRe, _ := regexp.Compile("^([0-9a-f]{40})$")
if commit := commitRe.FindString(head); commit != "" && env.Commit == "" { if commit := commitRe.FindString(head); commit != "" && env.Commit == "" {
env.Commit = commit env.Commit = commit
env.Date = getDate(env.Commit)
} }
return env return env
} }