Skip to content

Commit

Permalink
GIT-VERSION-GEN: squelch unneeded error from "cat version"
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Mar 3, 2006
1 parent 0cd5da5 commit 0b8b051
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion GIT-VERSION-GEN
Original file line number Diff line number Diff line change
Expand Up @@ -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*'\(.*\)')
Expand Down

0 comments on commit 0b8b051

Please sign in to comment.