diff --git a/Makefile b/Makefile index 60c085079d7b..f9aa7cfcef19 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ OUTPUT_IMAGE_ARCH ?= amd64 BUILD_DATE = $(shell date -u +'%Y-%m-%dT%H:%M:%SZ') GIT_COMMIT = $(shell git rev-parse HEAD) GIT_REMOTE = origin -GIT_BRANCH = $(shell git branch --show-current) +GIT_BRANCH = $(shell git rev-parse --symbolic-full-name --verify --quiet --abbrev-ref HEAD) GIT_TAG = $(shell git describe --exact-match --tags HEAD 2>/dev/null || git rev-parse --short=8 HEAD 2>/dev/null) GIT_TREE_STATE = $(shell if [ -z "`git status --porcelain`" ]; then echo "clean" ; else echo "dirty"; fi)