From 596f084eff9d661becdb614df7ea581f891db6c1 Mon Sep 17 00:00:00 2001 From: Benedikt Trefzer Date: Sat, 18 Dec 2021 12:41:26 +0100 Subject: [PATCH] make echo_info work if no tlsa is configured the echo_info function is defined in the timestamp file which should be sourced before using any function from there. --- hooks/post-commit | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hooks/post-commit b/hooks/post-commit index 8809ae8..38c912c 100644 --- a/hooks/post-commit +++ b/hooks/post-commit @@ -37,6 +37,10 @@ # address: info@mabulous.com # +DIR="${BASH_SOURCE%/*}" +if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi +. "$DIR/timestamping" + TSA0_URL=$(git config timestamping.tsa0.url) if [ -z "$TSA0_URL" ]; then # Do nothing if TSA0 has not been configured. @@ -44,10 +48,6 @@ if [ -z "$TSA0_URL" ]; then exit 0 fi -DIR="${BASH_SOURCE%/*}" -if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi -. "$DIR/timestamping" - extended_exit_trap() { local EXIT_CODE="$?" log "extended_exit_trap $EXIT_CODE"