From: Lars Hjemli Date: Wed, 20 Feb 2008 22:13:16 +0000 (+0100) Subject: Teach GIT-VERSION-GEN about the .git file X-Git-Tag: v1.5.6-rc0~93^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c48799e560c826905e87c8a8a71effeb0ca5e897;p=git.git Teach GIT-VERSION-GEN about the .git file The presence of a .git directory used to be good enough evidence that GIT-VERSION-GEN could use 'git describe' to get a version number. But now .git might as well be a file so the test must be extended to cater for such setups. Signed-off-by: Lars Hjemli Signed-off-by: Junio C Hamano --- diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index f60bab896..3cabc92e7 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -11,7 +11,7 @@ LF=' if test -f version then VN=$(cat version) || VN="$DEF_VER" -elif test -d .git && +elif test -d .git -o -f .git && VN=$(git describe --abbrev=4 HEAD 2>/dev/null) && case "$VN" in *$LF*) (exit 1) ;;