From a9f342c09e869201ef9495fca84ff60e21b2d80b Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sat, 17 Jan 2026 14:41:32 +0000 Subject: [PATCH] fix(pre-commit): only re-stage files that were already staged Prevents accidentally staging unrelated work-in-progress files when the formatter modifies files during pre-commit hook. --- .husky/pre-commit | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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!"