Skip to content

Commit 78da7e6

Browse files
ci: sync CI workflow
1 parent 16da212 commit 78da7e6

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.hooks/pre-commit

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@ set -euo pipefail
66

77
UNSTAGED_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

1121
while IFS= read -r file; do
1222
if [ -n "$file" ] && [ -f "$file" ]; then

0 commit comments

Comments
 (0)