From 2b65ed0302f8339db05640c6ee2bed16458c6e4b Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Tue, 25 Aug 2020 18:30:12 +0000 Subject: Fix the current working directory when setting GITREV and GITBRANCH. Sponsored by: Rubicon Communications, LLC (netgate.com) --- release/Makefile.inc1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'release') diff --git a/release/Makefile.inc1 b/release/Makefile.inc1 index 7d46f79adabd..3f650f863659 100644 --- a/release/Makefile.inc1 +++ b/release/Makefile.inc1 @@ -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 -- cgit v1.2.3