From b5fe3db418cde45351c1ede0c6f10aebea5eade6 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Fri, 30 May 2025 16:09:22 +0100 Subject: [PATCH] hook: fix GIT_DIR in delegate script $PWD gives us the absolute path to the git repository without using the bash builtin. Signed-off-by: oppiliappan --- hook/setup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook/setup.go b/hook/setup.go index 7316ab6..67deb89 100644 --- a/hook/setup.go +++ b/hook/setup.go @@ -141,7 +141,7 @@ func mkDelegate(path string) error { data=$(cat) exitcodes="" hookname=$(basename $0) -GIT_DIR=${GIT_DIR:-$(dirname $0)/..} +GIT_DIR="$PWD" for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do test -x "${hook}" && test -f "${hook}" || continue -- 2.51.2