Add support for multiple git-check-assertions blocks

This commit is contained in:
Sven van Heugten 2026-03-11 21:54:45 +01:00
parent 80ff74cdf9
commit 7e483b8a7f
No known key found for this signature in database
GPG key ID: D612F88666F4F660
4 changed files with 31 additions and 6 deletions

View file

@ -124,6 +124,27 @@ commit_with_assertion() {
assert_output "feature"
}
@test "multiple git-check-assertions blocks in one commit message run in order" {
git checkout -b feature
git commit --allow-empty -F - <<-EOF
test
\`\`\`git-check-assertions
touch ../test1
\`\`\`
\`\`\`git-check-assertions
touch ../test2
\`\`\`
EOF
run git-check-assertions
assert_success
assert_file_exists ../test1
assert_file_exists ../test2
}
@test "should stop at the first failing assertion block and return to the original branch" {
git checkout -b feature
commit_with_assertion "touch ../test1 && exit 3"