]> git.ipfire.org Git - thirdparty/git.git/blobdiff - GIT-VERSION-GEN
format-patch documentation: mention the special case of showing a single commit
[thirdparty/git.git] / GIT-VERSION-GEN
index 98d650aa621bda424218bfa800c4f90fe6050472..6c7465c75865577a87260c7936cb286ab84c6db6 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v1.5.5.4.GIT
+DEF_VER=v1.6.0.2.GIT
 
 LF='
 '
@@ -11,12 +11,13 @@ 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) ;;
        v[0-9]*)
-               test -z "$(git diff-index --name-only HEAD)" ||
+               git update-index -q --refresh
+               test -z "$(git diff-index --name-only HEAD --)" ||
                VN="$VN-dirty" ;;
        esac
 then