kazazor / git-pre-commit

A pre-commit hook that ignores all the unstagged changes while performing the pre-commit command you wrote (Using Shell, Gulp, Grunt etc..)
https://www.npmjs.com/package/git-pre-commit
MIT License
18 stars 5 forks source link

Git stashing is happening only after the check for "precommit" entry in package.json #17

Closed kazazor closed 8 years ago

kazazor commented 8 years ago

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.

kazazor commented 8 years ago

Fixed on v0.1.11