summaryrefslogtreecommitdiff
path: root/util/genbuild_h
diff options
context:
space:
mode:
Diffstat (limited to 'util/genbuild_h')
-rwxr-xr-xutil/genbuild_h/genbuild_h.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/genbuild_h/genbuild_h.sh b/util/genbuild_h/genbuild_h.sh
index 0a70eb8d1e..a3e44538ab 100755
--- a/util/genbuild_h/genbuild_h.sh
+++ b/util/genbuild_h/genbuild_h.sh
@@ -26,7 +26,9 @@ export LANG=C
export LC_ALL=C
export TZ=UTC
-if [ -d "${top}/.git" ] && [ -f "$(command -v git)" ]; then
+top=`dirname $0`/../..
+
+if [ -d "${top}/.git" -a -x "$(command -v git)" ]; then
GITREV=$(LANG= git log remotes/origin/master -1 --format=format:%h)
TIMESOURCE=git
DATE=$(git log --pretty=format:%ct -1)