aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKate Ward <kate.ward@forestent.com>2020-04-10 15:23:35 +0200
committerKate Ward <kate.ward@forestent.com>2020-04-10 15:23:35 +0200
commit653ff1c0136421839f58f3268bce07732449d3b4 (patch)
treee892393a862a3b77304315c2fbd9d7e32526b4e2
parent00bcdc5fff06dd021258295aa713d5e25d0f13a4 (diff)
downloadplatform_external_shflags-653ff1c0136421839f58f3268bce07732449d3b4.tar.gz
platform_external_shflags-653ff1c0136421839f58f3268bce07732449d3b4.tar.bz2
platform_external_shflags-653ff1c0136421839f58f3268bce07732449d3b4.zip
Fixes to hooks.
-rwxr-xr-x.githooks/generic9
1 files changed, 7 insertions, 2 deletions
diff --git a/.githooks/generic b/.githooks/generic
index 71d0122..b1b5cd0 100755
--- a/.githooks/generic
+++ b/.githooks/generic
@@ -12,6 +12,11 @@ run() {
${file}
}
+die() {
+ echo 'error: hook did not succeed' >&2
+ exit 1
+}
+
# Redirect output to stderr.
exec 1>&2
@@ -22,8 +27,8 @@ for f in $(cd ${githooks} && echo *); do
case "${f}" in
pre-commit.*)
# Called by "git commit" with no arguments.
- [ "${basename}" = 'pre-commit' ] && run pre-commit "${githooks}/${f}"
+ [ "${basename}" = 'pre-commit' ] || continue
+ run pre-commit "${githooks}/${f}" || die
;;
- *) ;;
esac
done