From: Maria Matejka Date: Sat, 10 May 2025 13:02:58 +0000 (+0200) Subject: Version script: fix detached mode X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fstable-v2.17;p=thirdparty%2Fbird.git Version script: fix detached mode --- diff --git a/tools/version b/tools/version index 6e591e34b..0ef4f13ec 100755 --- a/tools/version +++ b/tools/version @@ -47,7 +47,7 @@ esac # Add branch info if not passed via command line if [ -z "${BRANCH}" ]; then # There is also --show-current but it's too new to be portable. - BRANCH=$(git branch | sed -n 's/^[*] //p' | grep -v 'HEAD detached') + BRANCH=$(git branch | sed -n 's/^[*] //p' | grep -v 'HEAD detached' || true) fi # Found a branch