That is causing that if someone has removed the precommit entry in the package.json file, added it to the git index and then added it again to the file but didn't git add the file again -> it will still run the pre-commit hook.
We need to change the order of the checks and first perform the stashing and only then see if the entry exists or not.
That is causing that if someone has removed the
precommit
entry in thepackage.json
file, added it to the git index and then added it again to the file but didn'tgit add
the file again -> it will still run the pre-commit hook.We need to change the order of the checks and first perform the stashing and only then see if the entry exists or not.