From bfa2f9091fea9c1e9377c8ba4989c71d43855c4b Mon Sep 17 00:00:00 2001 From: Philip Withnall <pwithnall@gnome.org> Date: Tue, 28 Nov 2023 23:43:33 +0000 Subject: [PATCH] ci: Fix printing info message at end of run-style-check-diff.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The changes in commit 95479256df4a4693845be6a48dd85974c5c1c6d5 didn’t completely work (or some other change has broken them since): the informational message at the end of the script is now not printed. Fix that by stopping bash exiting immediately if the subshell exits, by using it in a boolean expression. Signed-off-by: Philip Withnall <pwithnall@gnome.org> --- .gitlab-ci/run-style-check-diff.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci/run-style-check-diff.sh b/.gitlab-ci/run-style-check-diff.sh index efe88abc3..c3cce249f 100755 --- a/.gitlab-ci/run-style-check-diff.sh +++ b/.gitlab-ci/run-style-check-diff.sh @@ -5,14 +5,14 @@ set -e ancestor_horizon=28 # days (4 weeks) # Wrap everything in a subshell so we can propagate the exit status. +exit_status=0 ( source .gitlab-ci/search-common-ancestor.sh git diff -U0 --no-color "${newest_common_ancestor_sha}" | .gitlab-ci/clang-format-diff.py -binary "clang-format-14" -p1 -) -exit_status=$? +) || exit_status=$? # The style check is not infallible. The clang-format configuration cannot # perfectly describe GLib’s coding style: in particular, it cannot align