Git - handling git repositories in parent folders (#171726)

This commit is contained in:
Ladislau Szomoru
2023-01-20 09:10:53 +01:00
committed by GitHub
parent 514900e23a
commit 78f9b06101
5 changed files with 265 additions and 67 deletions

View File

@@ -712,6 +712,11 @@
"command": "git.manageUnsafeRepositories",
"title": "%command.manageUnsafeRepositories%",
"category": "Git"
},
{
"command": "git.openRepositoriesInParentFolders",
"title": "%command.openRepositoriesInParentFolders%",
"category": "Git"
}
],
"continueEditSession": [
@@ -1162,6 +1167,10 @@
{
"command": "git.manageUnsafeRepositories",
"when": "config.git.enabled && !git.missing && git.unsafeRepositoryCount != 0"
},
{
"command": "git.openRepositoriesInParentFolders",
"when": "config.git.enabled && !git.missing && git.parentRepositoryCount != 0"
}
],
"scm/title": [
@@ -2674,6 +2683,22 @@
"experimental"
]
},
"git.openRepositoryInParentFolders": {
"type": "string",
"enum": [
"always",
"never",
"prompt"
],
"enumDescriptions": [
"%config.openRepositoryInParentFolders.always%",
"%config.openRepositoryInParentFolders.never%",
"%config.openRepositoryInParentFolders.prompt%"
],
"default": "prompt",
"markdownDescription": "%config.openRepositoryInParentFolders%",
"scope": "resource"
},
"git.publishBeforeContinueOn": {
"type": "string",
"enum": [
@@ -2837,14 +2862,14 @@
{
"view": "scm",
"contents": "%view.workbench.scm.empty%",
"when": "config.git.enabled && !git.missing && workbenchState == empty && git.unsafeRepositoryCount == 0",
"when": "config.git.enabled && !git.missing && workbenchState == empty && git.parentRepositoryCount == 0 && git.unsafeRepositoryCount == 0",
"enablement": "git.state == initialized",
"group": "2_open@1"
},
{
"view": "scm",
"contents": "%view.workbench.scm.emptyWorkspace%",
"when": "config.git.enabled && !git.missing && workbenchState == workspace && workspaceFolderCount == 0 && git.unsafeRepositoryCount == 0",
"when": "config.git.enabled && !git.missing && workbenchState == workspace && workspaceFolderCount == 0 && git.parentRepositoryCount == 0 && git.unsafeRepositoryCount == 0",
"enablement": "git.state == initialized",
"group": "2_open@1"
},
@@ -2861,15 +2886,25 @@
{
"view": "scm",
"contents": "%view.workbench.scm.folder%",
"when": "config.git.enabled && !git.missing && git.state == initialized && workbenchState == folder && scmRepositoryCount == 0 && git.unsafeRepositoryCount == 0 && remoteName != 'codespaces'",
"when": "config.git.enabled && !git.missing && git.state == initialized && workbenchState == folder && scmRepositoryCount == 0 && git.parentRepositoryCount == 0 && git.unsafeRepositoryCount == 0 && remoteName != 'codespaces'",
"group": "5_scm@1"
},
{
"view": "scm",
"contents": "%view.workbench.scm.workspace%",
"when": "config.git.enabled && !git.missing && git.state == initialized && workbenchState == workspace && workspaceFolderCount != 0 && scmRepositoryCount == 0 && git.unsafeRepositoryCount == 0 && remoteName != 'codespaces'",
"when": "config.git.enabled && !git.missing && git.state == initialized && workbenchState == workspace && workspaceFolderCount != 0 && scmRepositoryCount == 0 && git.parentRepositoryCount == 0 && git.unsafeRepositoryCount == 0 && remoteName != 'codespaces'",
"group": "5_scm@1"
},
{
"view": "scm",
"contents": "%view.workbench.scm.repositoryInParentFolders%",
"when": "config.git.enabled && !git.missing && git.state == initialized && git.parentRepositoryCount == 1"
},
{
"view": "scm",
"contents": "%view.workbench.scm.repositoriesInParentFolders%",
"when": "config.git.enabled && !git.missing && git.state == initialized && git.parentRepositoryCount > 1"
},
{
"view": "scm",
"contents": "%view.workbench.scm.unsafeRepository%",
@@ -2883,15 +2918,13 @@
{
"view": "explorer",
"contents": "%view.workbench.cloneRepository%",
"when": "config.git.enabled",
"enablement": "git.state == initialized",
"when": "config.git.enabled && git.state == initialized && scmRepositoryCount == 0",
"group": "5_scm@1"
},
{
"view": "explorer",
"contents": "%view.workbench.learnMore%",
"when": "config.git.enabled",
"enablement": "git.state == initialized",
"when": "config.git.enabled && git.state == initialized && scmRepositoryCount == 0",
"group": "5_scm@10"
}
]