Add failing test to check if the worktree is restored after failure

This test currently doesn't pass:

```git-check-assertions
run ./test/git-check-assertions.bats
assert_failure
assert_output --partial "file is greater than 0 byte"
```
This commit is contained in:
Sven van Heugten 2026-03-04 07:37:09 +01:00
parent 6963d06363
commit 99bcd7460f
No known key found for this signature in database
GPG key ID: D612F88666F4F660

View file

@ -99,6 +99,16 @@ commit_with_assertion() {
assert_size_zero ../test
}
@test "should restore worktree after a failure" {
git checkout -b feature
commit_with_assertion $'echo blah >> readme\nexit 3'
run git-check-assertions
assert_failure
assert_size_zero readme
}
@test "assertions should run against the version of the code inside of the commit" {
git checkout -b feature
echo commit1 >readme