tarmolov / git-hooks-js

A tool to manage and run project git hooks
167 stars 30 forks source link

getClosestGitPath does not work in git submodules #42

Closed Kampfgnom closed 6 years ago

Kampfgnom commented 7 years ago

In git submodules .git is a file pointing to the "real" git-dir instead of a directory.

The current implementation of getClosestGitPath does not take this case into account and the githooks --install command fails.

One possible solution is to use git rev-parse --git-dir to get the git directory for the cwd. I implemented that solution naively in my fork: https://github.com/Kampfgnom/git-hooks-js

The problem is: The tests expect a broken implementation and no longer pass with the given solution.

In the context of my current project I do not have the time to investigate any further and fix the issue, which is why I am posting my fork "as is".

tarmolov commented 6 years ago

See https://github.com/tarmolov/git-hooks-js/issues/48