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 <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lars Hjemli committed
Feb 20, 2008 at 23:13 UTC
c48799e560c826905e87c8a8a71effeb0ca5e897
1 file changed
+1
-1
GIT-VERSION-GEN
+1
-1
@@ -11,7 +11,7 @@ LF='
11
if test -f version
12
then
13
VN=$(cat version) || VN="$DEF_VER"
14
-elif test -d .git &&
14
+elif test -d .git -o -f .git &&
15
VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
16
case "$VN" in
17
*$LF*) (exit 1) ;;