stop failure to get commit id when in a git repository but not on

a tagged branch (fd 5 was non-existent).  Not tested with a tagged
branch.
This commit is contained in:
gardners 2013-10-22 12:23:03 -07:00
parent 6ee774f10b
commit fd6db45759

View File

@ -115,7 +115,14 @@ if [ -n "$dirty" ] && ! $allow_modified; then
fi
# Use the "git describe" command to form the version string and append $dirty.
if error="$( (desc="$(git describe --match="$version_tag_glob")" && echo "$desc$dirty") 2>&1 1>&5)" 5>&1; then
extragitflags=
set +e
error=`git describe --match="$version_tag_glob" 2>&1 1>/dev/null`
desc=`git describe --match="$version_tag_glob" 2>/dev/null`
set -e
if [ "x$error" == "x" ]; then
echo $desc$dirty
exit 0
fi