Add worktree command (#255945)

* Basic functionality of adding worktree

* Code refactoring and clean up

* Remove accidentally added submodules

* Specify folder destination

* Remove default worktree path, always prompt for destination instead

* create worktree only displayed in repo's worktree subcommands

* Git - handle another error condition when detecting worktrees (#256278)

* Rework creating worktree flow

* Include worktree name placeholder

---------

Co-authored-by: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com>
This commit is contained in:
Christy 😺
2025-07-16 11:54:45 -07:00
committed by GitHub
parent b9e82f6b60
commit 72aaf2bc9f
6 changed files with 102 additions and 3 deletions

View File

@@ -539,6 +539,12 @@
"category": "Git",
"enablement": "!operationInProgress"
},
{
"command": "git.createWorktree",
"title": "%command.createWorktree%",
"category": "Git",
"enablement": "!operationInProgress"
},
{
"command": "git.deleteWorktree",
"title": "%command.deleteWorktree%",
@@ -1295,6 +1301,10 @@
"command": "git.deleteTag",
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0"
},
{
"command": "git.createWorktree",
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0"
},
{
"command": "git.deleteWorktree",
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0"
@@ -2556,8 +2566,13 @@
],
"git.worktrees": [
{
"command": "git.deleteWorktree",
"when": "scmProviderContext == repository",
"command": "git.createWorktree",
"group": "worktrees@1"
},
{
"command": "git.deleteWorktree",
"group": "worktrees@2"
}
]
},