summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rwxr-xr-xutil/genbuild_h/genbuild_h.sh4
1 files changed, 1 insertions, 3 deletions
diff --git a/util/genbuild_h/genbuild_h.sh b/util/genbuild_h/genbuild_h.sh
index dfbfca55dc..95846ceae6 100755
--- a/util/genbuild_h/genbuild_h.sh
+++ b/util/genbuild_h/genbuild_h.sh
@@ -22,13 +22,11 @@ export LANG=C
export LC_ALL=C
export TZ=UTC0
-top=`dirname $0`/../..
-
if [ "${BUILD_TIMELESS}" = "1" ]; then
GITREV=Timeless
TIMESOURCE="fixed"
DATE=0
-elif GIT_DIR="${top}/.git" git status > /dev/null 2>&1; then
+elif [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then
GITREV=$(LANG= git log -1 --format=format:%h)
TIMESOURCE=git
DATE=$(git log --pretty=format:%ct -1)