diff --git a/bin/git-check-assertions b/bin/git-check-assertions index 5501358..4ebc513 100755 --- a/bin/git-check-assertions +++ b/bin/git-check-assertions @@ -84,6 +84,7 @@ for commit_hash in "${commits[@]}"; do printf '%s\n' "$block" | sed 's/^/> /' if ! bash -euo pipefail -c "$block"; then echo "git-check-assertions block failed in $commit_hash" >&2 + git restore -q . echo "Returning to $orig_ref" git checkout -q "$orig_ref" exit 1