mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-02-18 00:17:39 +01:00
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.
This commit is contained in:
@@ -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!"
|
||||
|
||||
Reference in New Issue
Block a user