Fix the current working directory when setting GITREV and

GITBRANCH.

Sponsored by:	Rubicon Communications, LLC (netgate.com)
This commit is contained in:
Glen Barber 2020-08-25 18:30:12 +00:00
parent 64f0728e67
commit 2b65ed0302

View File

@ -16,11 +16,11 @@ GIT_CMD= ${_P}/git
# Set the git branch and hash to export where needed.
.if !defined(GITBRANCH) || empty(GITBRANCH)
GITBRANCH!= ${GIT_CMD} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///'
GITBRANCH!= cd ${.CURDIR} && ${GIT_CMD} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///'
.export GITBRANCH
.endif
.if !defined(GITREV) || empty(GITREV)
GITREV!= ${GIT_CMD} rev-parse --verify --short HEAD 2>/dev/null || true
GITREV!= cd ${.CURDIR} && ${GIT_CMD} rev-parse --verify --short HEAD 2>/dev/null || true
.export GITREV
.endif