summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xget_vers.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/get_vers.sh b/get_vers.sh
index 7f281ae..c67a173 100755
--- a/get_vers.sh
+++ b/get_vers.sh
@@ -6,6 +6,15 @@ if test -f ${top_srcdir}/VERSION; then
VERSION=`cat ${top_srcdir}/VERSION`
elif test -d ${top_srcdir}/.git; then
VERSION=`(cd $top_srcdir; git describe --abbrev=6 --dirty | sed -e 's/%7E/~/')`
+
+ if test "$(git symbolic-ref HEAD)" != refs/heads/master; then
+ REF=$(git symbolic-ref --short HEAD)
+ if test "$REF" = "fatal: ref HEAD is not a symbolic ref"; then
+ VERSION="$VERSION: detached head"
+ else
+ VERSION="$VERSION $(echo $REF | tr 'a-z-' 'A-Z ')"
+ fi
+ fi
fi
if test -z "$VERSION"; then