forked from cerc-io/plugeth
Merge pull request #3073 from fjl/build-git17
internal/build: use less edgy command to get the branch name
This commit is contained in:
commit
ab7adb0027
@ -84,7 +84,9 @@ func LocalEnv() Environment {
|
|||||||
env.Commit = RunGit("rev-parse", "HEAD")
|
env.Commit = RunGit("rev-parse", "HEAD")
|
||||||
}
|
}
|
||||||
if env.Branch == "" {
|
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
|
// Note that we don't get the current git tag. It would slow down
|
||||||
// builds and isn't used by anything.
|
// builds and isn't used by anything.
|
||||||
|
Loading…
Reference in New Issue
Block a user