git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Bboaz_nahum@amat.com <boaz_nahum@amat.com>
Date
Feb 15, 2020, 21:11 UTC
Message-ID
<AM6PR09MB25980EF868A3FA782109D8DE9A140@AM6PR09MB2598.eurprd09.prod.outlook.com>
In-Reply-To
<AM6PR09MB2598893AEA5DB2D55DDFBF299A140@AM6PR09MB2598.eurprd09.prod.outlook.com>

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.
Message 1 of 1 in “FW: bug: fatal: this operation must be run in a work tree - after enabling worktreeConfig=true”
  1. boaz_nahum@amat.comFeb 15, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.