mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-04-28 03:20:11 +00: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:
parent
3096ec53b5
commit
a9f342c09e
1 changed files with 3 additions and 2 deletions
|
|
@ -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!"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue