From 09f59211edf56cca9386edf349ad105e9bb2f584 Mon Sep 17 00:00:00 2001
From: Dirk Hohndel <dirk@hohndel.org>
Date: Tue, 10 Sep 2024 10:33:28 -0700
Subject: [PATCH] build-system: de-clutter output of get-version.sh

In certain situations git merge-base would report errors if the branch
you are working in is older than the latest CICD builds. This simply
hides those pointless errors.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
---
 scripts/get-version.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/get-version.sh b/scripts/get-version.sh
index 73d9299a4..6ac5f307c 100755
--- a/scripts/get-version.sh
+++ b/scripts/get-version.sh
@@ -48,7 +48,7 @@ if [ ! -f latest-subsurface-buildnumber ] ; then
 	LAST_BUILD_BRANCHES=$(git branch -a --sort=-committerdate --list | grep remotes/origin/branch-for | cut -d/ -f3)
 	for LAST_BUILD_BRANCH in $LAST_BUILD_BRANCHES "not-found" ; do
 		LAST_BUILD_SHA=$(cut -d- -f 3 <<< "$LAST_BUILD_BRANCH")
-		git -C "$SUBSURFACE_SOURCE" merge-base --is-ancestor "$LAST_BUILD_SHA" HEAD && break
+		git -C "$SUBSURFACE_SOURCE" merge-base --is-ancestor "$LAST_BUILD_SHA" HEAD 2> /dev/null&& break
 	done
 	[ "not-found" = "$LAST_BUILD_BRANCH" ] && croak "can't find a build number for the current working tree"
 	git checkout "$LAST_BUILD_BRANCH" &> /dev/null || croak "failed to check out $LAST_BUILD_BRANCH in nightly-builds"