Print block number and remove redundant commit hash
This commit is contained in:
parent
32871dc261
commit
69f8acad8f
2 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue