summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2024-04-08 15:41:42 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2024-04-08 15:41:42 +0200
commit3481b5b35ea87408f04315f28f4fd14403703f5b (patch)
tree731dcd5b401c662e314ba9d9b733f1ad1adf3460
parentfe632d6351c97266597d57f32ee109731886be22 (diff)
Added safety check for active hook
-rw-r--r--post-commit.tmpl8
1 files changed, 7 insertions, 1 deletions
diff --git a/post-commit.tmpl b/post-commit.tmpl
index ea90110..df441fa 100644
--- a/post-commit.tmpl
+++ b/post-commit.tmpl
@@ -1,6 +1,12 @@
#!/usr/bin/env bash
-remote_url = {{ mirror_url }}
+hook_active= {{ active }}
+remote_url= {{ mirror_url }}
+
+if [ "$hook_active" == false ]; the
+ echo 'Mirror push hook is not active!'
+ exit(-1);
+fi
if git ls-remote $remote_url; then
echo "mirro_foo" > /tmp/mirror_foo