From 487cea384416a3ed47143feeefc5507f05439eac Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Tue, 6 Oct 2026 21:06:16 +0000 Subject: [PATCH] pre-push gate: clear git's hook environment (GIT_DIR and friends) so the self-tests' nested git never acts on this repository The first master push through the gate died inside remote-run.sh's self-test: its mirror push ran this repository's hook against the fixture tree. Shown fixed by a push to a local bare repository (the real hook, GREEN). Co-Authored-By: Claude Fable 5.1 --- tools/ci/pre-push.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/ci/pre-push.sh b/tools/ci/pre-push.sh index f596c9e5..c6364234 100755 --- a/tools/ci/pre-push.sh +++ b/tools/ci/pre-push.sh @@ -20,6 +20,10 @@ # and identity checks then read the committed pages; CI builds in place and checks the rebuilt pages, the one difference. set -uo pipefail cd "$(git rev-parse --show-toplevel)" || exit 1 +# git hands a hook its own repository through the environment (GIT_DIR, GIT_INDEX_FILE, GIT_PREFIX, ...). Left in place, +# every nested git inside the self-tests (remote-run.sh builds a mirror and pushes into it) would act on THIS repository +# and fire this hook again inside the fixture: the first master push through the gate died that way (6 October 2026). +unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_PREFIX GIT_COMMON_DIR GIT_OBJECT_DIRECTORY GIT_ALTERNATE_OBJECT_DIRECTORIES GIT_QUARANTINE_PATH GIT_PUSH_OPTION_COUNT MODE="${1:-local}"; MODE="${MODE#--}" RED=0; N=0; LOG="$(mktemp)"; trap 'rm -rf "$LOG" "${SITE_TMP:-}"' EXIT T0=$(date +%s)