Update pre-push hook, again

This commit is contained in:
Firepup Sixfifty 2025-03-27 21:00:13 -05:00
parent cda81045ee
commit 7dde0b6aae
Signed by: Firepup650
SSH key fingerprint: SHA256:in03N+Byhi/nMAIIKKMxbNMskVXULLrovhGkPNFEsdg

View file

@ -1,18 +1,8 @@
exitcode=
if [ -z "$(git ls-files -m -o --exclude-from=.gitignore)" ];then
echo No unstaged changes detected
else
echo The following files have unstaged changes:
git ls-files -m -o --exclude-from=.gitignore
fi
if [ -z "$(git status --porcelain -M|grep '^[^?]')" ];then
if [ -z "$(git status --porcelain -M)" ];then
echo No uncommited changes detected
else
echo The following files have uncommited changes:
git status --porcelain -M|grep '^[^?]'
fi
if [ -z "$exitcode" ];then
unset exitcode
git status --porcelain -M
echo Refusing to push
exit 1
fi