From 82599e542efb675b38d773753bc778f170bdb259 Mon Sep 17 00:00:00 2001 From: downtownallday Date: Wed, 22 Jun 2022 12:01:01 -0400 Subject: [PATCH] If git describe fails, assume new undetermined version --- tests/lib/installed-state.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/lib/installed-state.sh b/tests/lib/installed-state.sh index b092b98f..40c8ff8a 100644 --- a/tests/lib/installed-state.sh +++ b/tests/lib/installed-state.sh @@ -55,10 +55,17 @@ installed_state_capture() { local gitver=$(git describe) echo "GIT_VERSION='$gitver'" >>"$info" - parse_miab_version_string "$gitver" - if [ $? -ne 0 ]; then - echo "Unable to parse version string: $gitver" - return 1 + if [ -z "$gitver" ]; then + # git: "No names found, cannot describe anything" + MAJOR=999 + MINOR= + RELEASE= + else + parse_miab_version_string "$gitver" + if [ $? -ne 0 ]; then + echo "Unable to parse version string: '$gitver'" + return 1 + fi fi echo "MAJOR=$MAJOR" >>"$info" echo "MINOR=$MINOR" >>"$info"