From eb7372263ba3f4bd8565f6bf787f25e9df90c261 Mon Sep 17 00:00:00 2001 From: Zhang Dongliang Date: Tue, 8 Dec 2020 17:59:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(git,make):=20=E6=9B=B4=E6=96=B0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=20git=20branch=20=E7=9A=84=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0899384b94..936dba722d 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ BUILD_SCRIPT := $(ROOT_DIR)/build/build.sh ifeq ($(ONECLOUD_CI_BUILD),) GIT_COMMIT := $(shell git rev-parse --short HEAD) - GIT_BRANCH := $(shell git branch -r --contains | head -1 | sed -E -e "s%(HEAD ->|\s+|origin|upstream)/?%%g") + GIT_BRANCH := $(shell git branch -r --contains | head -1 | sed -E -e "s%(HEAD ->|origin|upstream)/?%%g" | xargs) GIT_VERSION := $(shell git describe --always --tags --abbrev=14 $(GIT_COMMIT)^{commit}) GIT_TREE_STATE := $(shell s=`git status --porcelain 2>/dev/null`; if [ -z "$$s" ]; then echo "clean"; else echo "dirty"; fi) BUILD_DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')