Wrap assertion checking in a function
This commit is contained in:
parent
ad5a6985ba
commit
d92713930e
1 changed files with 4 additions and 1 deletions
|
|
@ -118,7 +118,10 @@ for commit_hash in "${commits[@]}"; do
|
||||||
block_num=$((block_num + 1))
|
block_num=$((block_num + 1))
|
||||||
echo "git-check-assertions block $block_num:"
|
echo "git-check-assertions block $block_num:"
|
||||||
printf '%s' "$block" | sed 's/^/> /'
|
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
|
echo "git-check-assertions block failed in $commit_hash" >&2
|
||||||
restore
|
restore
|
||||||
echo "Returning to $orig_ref"
|
echo "Returning to $orig_ref"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue