diff options
author | Felix Lange <fjl@twurst.com> | 2016-10-03 16:22:14 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-10-03 16:22:14 +0800 |
commit | b4b5921dd030568717d33b03739d65c3aeb9d9af (patch) | |
tree | dcf737c02d0e5b92ac04d1a387cbdc51b3bc5516 | |
parent | c683e4aaa27c5f63ebecae6eada883933d26d063 (diff) | |
download | dexon-b4b5921dd030568717d33b03739d65c3aeb9d9af.tar dexon-b4b5921dd030568717d33b03739d65c3aeb9d9af.tar.gz dexon-b4b5921dd030568717d33b03739d65c3aeb9d9af.tar.bz2 dexon-b4b5921dd030568717d33b03739d65c3aeb9d9af.tar.lz dexon-b4b5921dd030568717d33b03739d65c3aeb9d9af.tar.xz dexon-b4b5921dd030568717d33b03739d65c3aeb9d9af.tar.zst dexon-b4b5921dd030568717d33b03739d65c3aeb9d9af.zip |
internal/build: use less edgy command to get the branch name
-rw-r--r-- | internal/build/env.go | 4 |
1 files changed, 3 insertions, 1 deletions
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. |