write_loose_object: don't bother trying to read an old object
[gitweb.git] / GIT-VERSION-GEN
index f60bab896bd9a54714eff3596e38c9ffb9d38ac8..3cabc92e7a1f8ce30eb6e5151a4c81c82468bcee 100755 (executable)
@@ -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) ;;