AnswerDotAI / AnswerDotAI/nbdev
Support git worktree in `nbdev_install_hooks`
Open
- Dominant language
- Jupyter Notebook
- Stars
- 5.3k
- Forks
- 513
- Avg merge
- 2d 30m
- Merged PRs (30d)
- 8
Description
When running `nbdev_install_hooks`, I get
```
NotADirectoryError: [Errno 20] Not a directory: '/dir1/.git/hooks'
```
This makes sense, because I'm using git's worktrees:
```
% cat .git
gitdir: /dir2/.git/worktrees/dir1
```
If I understand correctly, the issue is [here](https://github.com/fastai/nbdev/blob/master/nbdev/clean.py#L195-L199), 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`.
Contributor guide
Assessment
This issue has not been assessed yet.