GIT-VERSION-GEN: support non-standard $GIT_DIR path
authorDennis Kaarsemaker <dennis@kaarsemaker.net>
Sat, 15 Jun 2013 23:01:11 +0000 (01:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Jun 2013 20:09:17 +0000 (13:09 -0700)
make and make test both work when $GIT_DIR isn't .git, but make dist
included a bogus GIT-VERSION-FILE.

Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
GIT-VERSION-GEN
index 2908204894c33111075ad6b8c4b56bcacec08131..91ec831b0e5e5923bbc43b4900ed3f283ce67ff1 100755 (executable)
@@ -11,7 +11,7 @@ LF='
 if test -f version
 then
        VN=$(cat version) || VN="$DEF_VER"
-elif test -d .git -o -f .git &&
+elif test -d ${GIT_DIR:-.git} -o -f .git &&
        VN=$(git describe --match "v[0-9]*" --abbrev=7 HEAD 2>/dev/null) &&
        case "$VN" in
        *$LF*) (exit 1) ;;