diff --git a/README.md b/README.md index 58f79f7..0b302ca 100644 --- a/README.md +++ b/README.md @@ -49,3 +49,14 @@ dotnet build (assert_fails dotnet test --no-build) | grep "Invalid URL" ``` ~~~ + +Assert that a commit builds, and that a specific change breaks the tests (as discussed [here](https://sven.memcmp.org/2026-02-20-writing-the-steps-to-validate-a-test-in-the-commit-message/)): + +~~~ +```git-check-assertions +dotnet test +sed -i '/crucial code/d' Main.fs +dotnet build +assert_fails dotnet test --no-build +``` +~~~ diff --git a/git-check-assertions.sh b/git-check-assertions.sh index 1acab64..b0fe652 100755 --- a/git-check-assertions.sh +++ b/git-check-assertions.sh @@ -53,6 +53,7 @@ for commit_hash in "${commits[@]}"; do git checkout -q "$orig_ref" exit 1 fi + git restore -q . fi echo done