File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,17 @@ set -euo pipefail
66
77UNSTAGED_BEFORE=$( git diff --name-only 2> /dev/null || true)
88
9- just pre-commit
9+ # Strip repo-scoped git env vars from `just pre-commit` so subprocess git
10+ # operations (uv clones, pytest git fixtures, go builds) don't inherit
11+ # GIT_INDEX_FILE/GIT_DIR and write into the invoking repo's index.
12+ # The git diff/add calls below keep their env vars and work correctly.
13+ env -u GIT_ALTERNATE_OBJECT_DIRECTORIES -u GIT_COMMON_DIR -u GIT_CONFIG \
14+ -u GIT_CONFIG_PARAMETERS -u GIT_DIR -u GIT_GRAFT_FILE \
15+ -u GIT_IMPLICIT_WORK_TREE -u GIT_INDEX_FILE \
16+ -u GIT_INTERNAL_SUPER_PREFIX -u GIT_NO_REPLACE_OBJECTS \
17+ -u GIT_OBJECT_DIRECTORY -u GIT_PREFIX -u GIT_REPLACE_REF_BASE \
18+ -u GIT_SHALLOW_FILE -u GIT_WORK_TREE \
19+ just pre-commit
1020
1121while IFS= read -r file; do
1222 if [ -n " $file " ] && [ -f " $file " ]; then
You can’t perform that action at this time.
0 commit comments