Enable viewing of worktrees under Repositories (#254992)

* init

* fix: correct configuration key for detecting Git worktrees

* Fixed misspelling of worktrees and populated worktree list

* exported parseGitWorktrees

* Replaced git commands with file system reader

* Removed trailing './git' from path

* Prevent errors when accessing empty worktree directory

* Enable worktree deletion

* code clean up

* Remove exposure to git extension

* labeling and minor fixes

* throw error when no worktrees created

* Error handling when getting worktrees

---------

Co-authored-by: bhavyaus <bhavyau@microsoft.com>
This commit is contained in:
Christy 😺
2025-07-14 11:27:00 -07:00
committed by GitHub
parent c068082c35
commit 4576aa4385
7 changed files with 188 additions and 5 deletions

View File

@@ -539,6 +539,12 @@
"category": "Git",
"enablement": "!operationInProgress"
},
{
"command": "git.deleteWorktree",
"title": "%command.deleteWorktree%",
"category": "Git",
"enablement": "!operationInProgress"
},
{
"command": "git.graph.deleteTag",
"title": "%command.graphDeleteTag%",
@@ -1289,6 +1295,10 @@
"command": "git.deleteTag",
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0"
},
{
"command": "git.deleteWorktree",
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0"
},
{
"command": "git.deleteRemoteTag",
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0"
@@ -1609,6 +1619,11 @@
"group": "2_main@7",
"when": "scmProvider == git"
},
{
"submenu": "git.worktrees",
"group": "2_main@8",
"when": "scmProvider == git"
},
{
"command": "git.showOutput",
"group": "3_footer",
@@ -2538,6 +2553,12 @@
"command": "git.deleteRemoteTag",
"group": "tags@3"
}
],
"git.worktrees": [
{
"command": "git.deleteWorktree",
"group": "worktrees@1"
}
]
},
"submenus": [
@@ -2568,6 +2589,10 @@
{
"id": "git.tags",
"label": "%submenu.tags%"
},
{
"id": "git.worktrees",
"label": "%submenu.worktrees%"
}
],
"configuration": {
@@ -2977,6 +3002,18 @@
"default": 10,
"description": "%config.detectSubmodulesLimit%"
},
"git.detectWorktrees": {
"type": "boolean",
"scope": "resource",
"default": false,
"description": "%config.detectWorktrees%"
},
"git.detectWorktreesLimit": {
"type": "number",
"scope": "resource",
"default": 10,
"description": "%config.detectWorktreesLimit%"
},
"git.alwaysShowStagedChangesResourceGroup": {
"type": "boolean",
"scope": "resource",