internal/build: add support for git tag in local Environment
I didn't add this initially because the command I tried was too slow. The 'git for-each-ref ...' invocation takes 40ms on my machine. That ought to be acceptable.
This commit is contained in:
@ -88,8 +88,9 @@ func LocalEnv() Environment {
|
||||
env.Branch = b
|
||||
}
|
||||
}
|
||||
// Note that we don't get the current git tag. It would slow down
|
||||
// builds and isn't used by anything.
|
||||
if env.Tag == "" {
|
||||
env.Tag = RunGit("for-each-ref", "--points-at=HEAD", "--count=1", "--format=%(refname:short)", "refs/tags")
|
||||
}
|
||||
return env
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user