From 3481b5b35ea87408f04315f28f4fd14403703f5b Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 8 Apr 2024 15:41:42 +0200 Subject: Added safety check for active hook --- post-commit.tmpl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'post-commit.tmpl') 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 -- cgit v1.2.3