From d92713930e7a5b4b64cc2866b70e0ff6b0eb0035 Mon Sep 17 00:00:00 2001 From: Sven van Heugten Date: Wed, 15 Apr 2026 20:49:16 +0200 Subject: [PATCH] Wrap assertion checking in a function --- bin/git-check-assertions | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/git-check-assertions b/bin/git-check-assertions index 1195884..5cc842f 100755 --- a/bin/git-check-assertions +++ b/bin/git-check-assertions @@ -118,7 +118,10 @@ for commit_hash in "${commits[@]}"; do block_num=$((block_num + 1)) echo "git-check-assertions block $block_num:" printf '%s' "$block" | sed 's/^/> /' - if ! bash -euo pipefail -c "$block"; then + check_assertions() { + bash -euo pipefail -c "$block" + } + if ! check_assertions; then echo "git-check-assertions block failed in $commit_hash" >&2 restore echo "Returning to $orig_ref"