nbdev
nbdev copied to clipboard
Support git worktree in `nbdev_install_hooks`
When running nbdev_install_hooks
, I get
NotADirectoryError: [Errno 20] Not a directory: '<path>/dir1/.git/hooks'
This makes sense, because I'm using git's worktrees:
% cat .git
gitdir: <path>/dir2/.git/worktrees/dir1
If I understand correctly, the issue is here, where the code assumes that the .git
directory is $(git rev-parse --show-toplevel)/.git
; instead, it should ask git
directly via git rev-parse --git-dir
.