diff --git a/.husky/pre-commit b/.husky/pre-commit index 5d9a0bf0d..69c37bc82 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -49,7 +49,8 @@ if [ -f frontend-modern/package.json ]; then cd .. fi -# Stage formatted files -git add -u +# Re-stage only files that were already staged (to pick up formatter changes) +# This avoids accidentally committing unrelated work-in-progress files +git diff --cached --name-only -z | xargs -0 -r git add echo "Pre-commit checks passed!"