From fd6db4575993fe09cfd716c82882f900d4175e25 Mon Sep 17 00:00:00 2001 From: gardners Date: Tue, 22 Oct 2013 12:23:03 -0700 Subject: [PATCH] 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. --- version_string.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/version_string.sh b/version_string.sh index 0a7cd3df..998f9eed 100755 --- a/version_string.sh +++ b/version_string.sh @@ -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