I have pre-push hook that executes my unit tests. When tests fail, push failed as well. However this stopped, noticed today, so when my unit tests fail, my code is pushed.
Tried to address this by adding set -euo pipefail
, but no change, faulty code is still pushed to remote.
This is my whole pre-push:
#!/bin/sh
set -euo pipefail
docker-compose exec my-container composer test
If I run it directly from terminal and tests fail, pre-push fails, exit code is not zero.
Fellow developer has the same script on same GIT version, but it works for him. Edit: after closer look he realized it does not work for him neither. Perhaps something with git version?
Any idea why my push proceeds even though my pre-push hook fails?