'git rev-parse --show-toplevel' errors out with per-worktree configs
- From
- Clement Moyroud <clement.moyroud@gmail.com>
- Date
- Jul 14, 2020, 19:40 UTC
- Message-ID
- <CABXAcUxw5EA6jPB93C-Cfg-tycLMQSKUgrLkLXSQUZPHeEva9Q@mail.gmail.com>
Hello,
I have a bare repository clone that I create worktrees off. This works fine, including 'git rev-parse --show-toplevel'.
I enabled per-worktree configs using 'git config --local extensions.worktreeconfig=true', and now I can't get the toplevel anymore:
> git rev-parse --show-toplevel
fatal: this operation must be run in a work tree
Disabling per-worktree configs makes it work again. This also works fine on a non-bare repository clone.
IOW, this works: git clone <url> non-bare (cd non-bare && git worktree add -b master2 ../wtree1 master) (cd wtree1 && git rev-parse --show-toplevel)
This does not: git clone -c extensions.worktreeConfig=true <url> bare.git (cd bare.git && git worktree add -b master2 ../wtree2 master) (cd wtree2 && git rev-parse --show-toplevel)
Is this a bug, or am I missing something?
Thanks,
Clément