nbdev icon indicating copy to clipboard operation
nbdev copied to clipboard

Support git worktree in `nbdev_install_hooks`

Open alex-rozenshteyn-leapyear opened this issue 2 years ago • 0 comments

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.