Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

fix(eval): scrub git's hook environment before tier-1 spawns children

Rach Pradhan87c8348ccf0b
diff --git a/scripts/eval-tier1.sh b/scripts/eval-tier1.sh
index f894b1b2..9a6e1d82 100644
--- a/scripts/eval-tier1.sh
+++ b/scripts/eval-tier1.sh
@@ -16,6 +16,15 @@ set -uo pipefail
repo_root=$(git -C "$(dirname "${BASH_SOURCE[0]}")/.." rev-parse --show-toplevel)
cd "$repo_root"
+# git exports GIT_DIR (and friends) to hooks. Anything this script spawns —
+# the test suite's git-fixture tests, graff itself in the sdk check — inherits
+# them, and a child's `git init`/`git commit` in its OWN tmpdir then operates
+# on THIS repo instead: `git init` re-marks the checkout bare (core.bare=true)
+# and `git commit` lands a stray "fixture" commit on the current branch, with
+# the tmpdir as the work tree. Scrub the hook environment so child git
+# processes discover their repo from their cwd like they expect.
+unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_COMMON_DIR GIT_OBJECT_DIRECTORY GIT_PREFIX
+
CHECKS=(fmt lines reach build tests invariants sdk)
usage() {