diff options
author | Junio C Hamano <junkio@cox.net> | 2006-03-02 14:38:44 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-03-02 16:42:39 -0800 |
commit | 0b8b051cd50cb423476ab7a8aa5853dc601b721d (patch) | |
tree | 944b4e2a53a02055c33fbb3c6d96a212bb594c23 | |
parent | Merge branch 'ml/cvsserver' (diff) | |
download | tgif-0b8b051cd50cb423476ab7a8aa5853dc601b721d.tar.xz |
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>
-rwxr-xr-x | GIT-VERSION-GEN | 5 |
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*'\(.*\)') |