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"