From 17d53810597dd69a8717748af7a82bacf5aa203b Mon Sep 17 00:00:00 2001 From: Connor and Luan Santos Date: Thu, 4 Jun 2015 17:07:28 -0700 Subject: [PATCH] build: default git sha to GitNotFound in case git fails --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index 2bb96e58f..e18ab2590 100755 --- a/build +++ b/build @@ -11,7 +11,7 @@ ln -s ${PWD} $GOPATH/src/${REPO_PATH} eval $(go env) -GIT_SHA=`git rev-parse --short HEAD` +GIT_SHA=`git rev-parse --short HEAD || echo "GitNotFound"` # Static compilation is useful when etcd is run in a container CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s -X ${REPO_PATH}/version.GitSHA ${GIT_SHA}" -o bin/etcd ${REPO_PATH}