Skip to content

Commit

Permalink
build-system: de-clutter output of get-version.sh
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dirkhh authored and mikeller committed Sep 20, 2024
1 parent c8ef53c commit 09f5921
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/get-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 09f5921

Please sign in to comment.