Permission denied error on worktree index.lock when committing from VS Code (Electron sandbox issue with git)
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 6
説明
### Describe the bug
In a VS Code window opened on a Git worktree, I'm getting a permissions error when trying to commit staged changes. The error message is:
```
[0204/181621.495272:ERROR:electron/shell/app/node_main.cc:146] Node.js environment variables are disabled because this process is invoked by other apps.
fatal: Unable to create '/Users/cv/Documents/Projects/GEO-Skunkworks/geo-experiments-new/.git/worktrees/exp-azure-hosted-agent-claude-code/index.lock': Operation not permitted
```
This prevents committing from that window. The files are already staged, and committing from the terminal outside VS Code works as expected.
### Affected version
_No response_
### Steps to reproduce the behavior
1. Open a VS Code window on a Git worktree (not the main repo).
2. Stage changes to files in the worktree.
3. Attempt to commit using the built-in Git tools in VS Code or via the integrated terminal.
4. Observe the error:
[0204/181621.495272:ERROR:electron/shell/app/node_main.cc:146] Node.js environment variables are disabled because this process is invoked by other apps.
fatal: Unable to create '/path/to/.git/worktrees/worktree-name/index.lock': Operation not permitted
### Expected behavior
I expected to be able to commit staged changes from the VS Code window on the worktree without permission errors, similar to committing from the main repo or an external terminal.
### Additional context
- macOS
- VS Code, using built-in Git support
- Problem occurs only in worktrees
- External terminal can commit successfully
- Error mentions Electron, possibly points to a Node.js/electron/VSC sandbox issue
- Path permissions appear correct
- No visible lock files blocking the process
コントリビューションガイド
評価
この issue はまだ評価されていません。