internal/build: use less edgy command to get the branch name

release/1.5
Felix Lange 8 years ago
parent c683e4aaa2
commit b4b5921dd0
  1. 4
      internal/build/env.go

@ -84,7 +84,9 @@ func LocalEnv() Environment {
env.Commit = RunGit("rev-parse", "HEAD")
}
if env.Branch == "" {
env.Branch = RunGit("symbolic-ref", "-q", "--short", "HEAD")
if b := RunGit("rev-parse", "--abbrev-ref", "HEAD"); b != "HEAD" {
env.Branch = b
}
}
// Note that we don't get the current git tag. It would slow down
// builds and isn't used by anything.

Loading…
Cancel
Save