git-version-gen: Avoid further processing when tarball-version is present

In case a tarball-version file is present, use that and quit.

Otherwise git will continue looking for directories, potentially
finding .git directories which are dirty and mark the version as such.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90936
This commit is contained in:
Ross Burton 2015-10-20 16:55:23 +02:00 committed by David Henningsson
parent f277f2c509
commit c25b06577c

View File

@ -84,7 +84,10 @@ then
v=`cat $tarball_version_file` || exit 1
case $v in
*$nl*) v= ;; # reject multi-line output
[0-9]*) ;;
[0-9]*)
echo "$v" | tr -d '\012'
exit 0
;;
*) v= ;;
esac
test -z "$v" \