From b4b5921dd030568717d33b03739d65c3aeb9d9af Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 3 Oct 2016 10:22:14 +0200 Subject: [PATCH] internal/build: use less edgy command to get the branch name --- internal/build/env.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/build/env.go b/internal/build/env.go index 87b4c57ac..3f63239ca 100644 --- a/internal/build/env.go +++ b/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.