observing / pre-commit

Automatically installs a git pre-commit script in your git repository which runs your `npm test` on pre-commit
MIT License
1.88k stars 153 forks source link

Doesn't find git root when inside a submodule #152

Open adamwight opened 3 years ago

adamwight commented 3 years ago

No hooks are installed when the repo has been cloned as a submodule. In this case, the .git file is plain text pointing to a directory under the parent .git/modules/....

I see code to handle this case, but it is unreachable because the condition here triggers first: https://github.com/observing/pre-commit/blob/master/install.js#L26