handle the git '(no branch)' case

r3815 | dcl | 2012-11-22 10:09:54 +1100 (Thu, 22 Nov 2012) | 1 line
This commit is contained in:
Douglas Clowes
2012-11-22 10:09:54 +11:00
parent 55325dd704
commit a09333a655

View File

@ -39,7 +39,7 @@ else
git log -1 2>&1 >> /dev/null
if [ $? == 0 ]
then
SICS_VER="$(git branch | grep '^*' | cut -d ' ' -f 2)"
SICS_VER="$(git branch | grep '^*' | sed 's/^\* *//')"
SICS_REV="$(git log -1 --oneline | cut -d ' ' -f 1)"
else
SICS_VER="$USER"