threads / bug / 52813

FW: bug: fatal: this operation must be run in a work tree - after enabling worktreeConfig=true

Subject: FW: bug: fatal: this operation must be run in a work tree - after enabling worktreeConfig=true

## tl;dr

One message between Feb 15, 2020 and Feb 15, 2020.

replies: 0people: 1as markdown or json

boaz_nahum@amat.com· Feb 15, 2020, 21:11 UTC · lore

Hi (English is not my language)

We started to work with sparse-checkout and we found two issues.
We work with bare repository, with a worktree 'arounds' it.
Two issues:
Issue 1) fatal: this operation must be run in a work tree
TO reproduce, In bare repository:
   git worktree add ../testwt pub/empty -no-checkout
Switch to worktree
  git sparse-checkout init
Result:
    fatal: this operation must be run in a work tree
any operation in any worktree now ends with:
    fatal: this operation must be run in a work tree
This is because  extensions.worktreeConfig=true
Workaround
1. core.bare=false in bare - not acceptable
2. Remove worktreeConfig=true  - not good idea if we want to work with sparse-checkout
3. core.bare=false  in worktree, but we need to apply it on any worktree
Please note that this happens even  if in time of creating worktree worktreeConfig=true
Issue 2) fatal: Unable to create 'F:/views/MonoCentral/worktrees/testwt3/info/sparse-checkout.lock': No such file or directory
To reproduce, same as above, but worktreeConfig=false before starting,
Result:
    fatal: Unable to create 'F:/views/MonoCentral/worktrees/testwt3/info/sparse-checkout.lock': No such file or directory
Workaround:
  Set extensions.worktreeConfig=true  before adding the worktree or running sparse-checkout

Thanks Boaz

The content of this message is APPLIED MATERIALS CONFIDENTIAL. If you are not the intended recipient, please notify me, delete this email and do not use or distribute this email.

← back to recent threads