From f5a0be5909f64049304cc253123a5f9e4c5f38a3 Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Sun, 16 Aug 2009 12:18:21 +0200 Subject: [PATCH] gitrev.sh: search harder for the git dir If gitrev.sh was called from an objdir, it would not be able to find the git dir and thus fail to determine the version. Try harder by either using an argument as source (sub) dir, or using the path of the gitrev.sh script itself. --- tools/gitrev.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/gitrev.sh b/tools/gitrev.sh index 37fbd93133..01d0343b1d 100755 --- a/tools/gitrev.sh +++ b/tools/gitrev.sh @@ -1,5 +1,9 @@ #!/bin/sh +srcdir=${1:-$(dirname $0)} + +[ -n "$srcdir" ] && cd "$srcdir" + if ! which git >/dev/null 2>&1 || ! cd "$(dirname "$0")" || ! git rev-parse --git-dir >/dev/null 2>&1 -- 2.41.0