I have a pre-commit hook that will modify the staged files and re-add those files with git add . at the end of the script. It works as expected with git c
git add .
git c