mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-28 08:37:22 +00:00
[release/1.4.15] internal/build: use less edgy command to get the branch name
(cherry picked from commit b4b5921dd0)
This commit is contained in:
parent
9315bc9c3c
commit
ee58202f2f
1 changed files with 3 additions and 1 deletions
|
|
@ -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…
Reference in a new issue