Print block number and remove redundant commit hash

This commit is contained in:
Sven van Heugten 2026-03-11 22:41:14 +01:00
parent 32871dc261
commit 69f8acad8f
No known key found for this signature in database
GPG key ID: D612F88666F4F660
2 changed files with 5 additions and 1 deletions

View file

@ -110,8 +110,10 @@ for commit_hash in "${commits[@]}"; do
printf '%s\n' "$commit_msg" |
perl -0777 -ne 'while (/^```git-check-assertions\s*\n(.*?)^```\s*$/msg){ print $1, "\0" }'
)
block_num=0
for block in "${blocks[@]}"; do
echo "git-check-assertions block in $commit_hash:"
block_num=$((block_num + 1))
echo "git-check-assertions block $block_num:"
printf '%s' "$block" | sed 's/^/> /'
if ! bash -euo pipefail -c "$block"; then
echo "git-check-assertions block failed in $commit_hash" >&2

View file

@ -141,6 +141,8 @@ commit_with_assertion() {
run git-check-assertions
assert_success
assert_output --partial "git-check-assertions block 1:"
assert_output --partial "git-check-assertions block 2:"
assert_file_exists ../test1
assert_file_exists ../test2
}