From 91e07a8cc2139bb637e04e9a7c5e5da5eb0526f6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 06:49:04 +0000 Subject: [PATCH 1/2] Initial plan From 7681f66e8ad82234cbf126d8e42ba48713bf3c9a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 06:50:14 +0000 Subject: [PATCH 2/2] fix: resolve hook destination from git config core.hooksPath Co-authored-by: tannn <831788+tannn@users.noreply.github.com> --- scripts/setup-hooks.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/setup-hooks.sh b/scripts/setup-hooks.sh index 61a7970..ed62f69 100644 --- a/scripts/setup-hooks.sh +++ b/scripts/setup-hooks.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# setup-hooks.sh — install tracked git hooks into .git/hooks/ +# setup-hooks.sh — install tracked git hooks into the active git hooks directory # # Run once after cloning: # bash scripts/setup-hooks.sh @@ -10,7 +10,18 @@ set -euo pipefail REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" HOOKS_SOURCE="$REPO_ROOT/git-hooks" -HOOKS_DEST="$REPO_ROOT/.git/hooks" + +# Respect core.hooksPath when configured; fall back to .git/hooks +_configured_path="$(git -C "$REPO_ROOT" config core.hooksPath 2>/dev/null || true)" +if [[ -n "$_configured_path" ]]; then + # core.hooksPath may be relative — resolve it from the repo root + case "$_configured_path" in + /*) HOOKS_DEST="$_configured_path" ;; + *) HOOKS_DEST="$REPO_ROOT/$_configured_path" ;; + esac +else + HOOKS_DEST="$REPO_ROOT/.git/hooks" +fi if [[ ! -d "$HOOKS_SOURCE" ]]; then printf '[setup-hooks] ERROR: %s not found. Run from repo root.\n' "$HOOKS_SOURCE" >&2