When running opencommit hook set in a repository that is a submodule of another repository, it displays the following error:
┌ setting opencommit as 'prepare-commit-msg' hook at .git/hooks/prepare-commit-msg
│
└ ✖ Error: ENOTDIR: not a directory, mkdir '.git/hooks'
It's trying to add the hook to the folder in the .git folder but this is not a folder, rather a file, pointing to the parent repo with a git subfolder:
gitdir: ../.git/modules/malong
Expected Behavior
When running opencommit hook set the hook will be set for the submodule repository.
Current Behavior
It's giving an error when trying to do this: ✖ Error: ENOTDIR: not a directory, mkdir '.git/hooks'
Possible Solution
Maybe it's possible to check the file and locate the git folder for this submodule... or maybe change the way the hook is set by using git commands for this? I'm afraid I don't really have the knowledge for this..
Steps to Reproduce
Create a repository.
Create a repository which is a git submodule of the parent repository.
Run opencommit hook set on the submodule repository
See the error coming up ✖ Error: ENOTDIR: not a directory, mkdir '.git/hooks'
Relevant log output
┌ setting opencommit as 'prepare-commit-msg' hook at .git/hooks/prepare-commit-msg
│
└ ✖ Error: ENOTDIR: not a directory, mkdir '.git/hooks'
Opencommit Version
2.4.1
Node Version
18.12.1
NPM Version
8.19.2
What OS are you seeing the problem on?
Mac
What happened?
When running
opencommit hook set
in a repository that is a submodule of another repository, it displays the following error:It's trying to add the hook to the folder in the
.git
folder but this is not a folder, rather a file, pointing to the parent repo with a git subfolder:Expected Behavior
When running
opencommit hook set
the hook will be set for the submodule repository.Current Behavior
It's giving an error when trying to do this:
✖ Error: ENOTDIR: not a directory, mkdir '.git/hooks'
Possible Solution
Maybe it's possible to check the file and locate the git folder for this submodule... or maybe change the way the hook is set by using git commands for this? I'm afraid I don't really have the knowledge for this..
Steps to Reproduce
opencommit hook set
on the submodule repository✖ Error: ENOTDIR: not a directory, mkdir '.git/hooks'
Relevant log output