aboutsummaryrefslogtreecommitdiffstats
path: root/internal
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-10-03 16:22:14 +0800
committerFelix Lange <fjl@twurst.com>2016-10-03 16:22:14 +0800
commitb4b5921dd030568717d33b03739d65c3aeb9d9af (patch)
treedcf737c02d0e5b92ac04d1a387cbdc51b3bc5516 /internal
parentc683e4aaa27c5f63ebecae6eada883933d26d063 (diff)
downloadgo-tangerine-b4b5921dd030568717d33b03739d65c3aeb9d9af.tar
go-tangerine-b4b5921dd030568717d33b03739d65c3aeb9d9af.tar.gz
go-tangerine-b4b5921dd030568717d33b03739d65c3aeb9d9af.tar.bz2
go-tangerine-b4b5921dd030568717d33b03739d65c3aeb9d9af.tar.lz
go-tangerine-b4b5921dd030568717d33b03739d65c3aeb9d9af.tar.xz
go-tangerine-b4b5921dd030568717d33b03739d65c3aeb9d9af.tar.zst
go-tangerine-b4b5921dd030568717d33b03739d65c3aeb9d9af.zip
internal/build: use less edgy command to get the branch name
Diffstat (limited to 'internal')
-rw-r--r--internal/build/env.go4
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.