summaryrefslogtreecommitdiff
path: root/GIT-VERSION-GEN
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-02 14:38:44 -0800
committerJunio C Hamano <junkio@cox.net>2006-03-02 16:42:39 -0800
commit0b8b051cd50cb423476ab7a8aa5853dc601b721d (patch)
tree944b4e2a53a02055c33fbb3c6d96a212bb594c23 /GIT-VERSION-GEN
parent0cd5da56fa1287a368bb7e0d0e1379591d13f239 (diff)
downloadgit-0b8b051cd50cb423476ab7a8aa5853dc601b721d.tar.gz
GIT-VERSION-GEN: squelch unneeded error from "cat version"
Now this is really a corner case, but if you have the git source tree from somewhere other than the official tarball, you do not have version file. And if git-describe does not work for you (maybe you do not have git yet), we spilled an error message from "cat version". Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'GIT-VERSION-GEN')
-rwxr-xr-xGIT-VERSION-GEN5
1 files changed, 4 insertions, 1 deletions
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 1056b7c817..d6d1ae0338 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -7,8 +7,11 @@ DEF_VER=v1.2.GIT
# (included in release tarballs), then default
if VN=$(git-describe --abbrev=4 HEAD 2>/dev/null); then
VN=$(echo "$VN" | sed -e 's/-/./g');
-else
+elif test -f version
+then
VN=$(cat version) || VN="$DEF_VER"
+else
+ VN="$DEF_VER"
fi
VN=$(expr "$VN" : v*'\(.*\)')