mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Git - add command to close other repositories (#200893)
This commit is contained in:
parent
29a6631393
commit
81207cddf5
|
@ -98,6 +98,12 @@
|
||||||
"category": "Git",
|
"category": "Git",
|
||||||
"enablement": "!operationInProgress"
|
"enablement": "!operationInProgress"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "git.closeOtherRepositories",
|
||||||
|
"title": "%command.closeOtherRepositories%",
|
||||||
|
"category": "Git",
|
||||||
|
"enablement": "!operationInProgress"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "git.refresh",
|
"command": "git.refresh",
|
||||||
"title": "%command.refresh%",
|
"title": "%command.refresh%",
|
||||||
|
@ -827,6 +833,10 @@
|
||||||
"command": "git.close",
|
"command": "git.close",
|
||||||
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0"
|
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "git.closeOtherRepositories",
|
||||||
|
"when": "false"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "git.refresh",
|
"command": "git.refresh",
|
||||||
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0"
|
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0"
|
||||||
|
@ -1336,8 +1346,13 @@
|
||||||
"scm/sourceControl": [
|
"scm/sourceControl": [
|
||||||
{
|
{
|
||||||
"command": "git.close",
|
"command": "git.close",
|
||||||
"group": "navigation",
|
"group": "navigation@1",
|
||||||
"when": "scmProvider == git"
|
"when": "scmProvider == git"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "git.closeOtherRepositories",
|
||||||
|
"group": "navigation@2",
|
||||||
|
"when": "scmProvider == git && gitOpenRepositoryCount > 1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"scm/resourceGroup/context": [
|
"scm/resourceGroup/context": [
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
"command.openRepository": "Open Repository",
|
"command.openRepository": "Open Repository",
|
||||||
"command.reopenClosedRepositories": "Reopen Closed Repositories...",
|
"command.reopenClosedRepositories": "Reopen Closed Repositories...",
|
||||||
"command.close": "Close Repository",
|
"command.close": "Close Repository",
|
||||||
|
"command.closeOtherRepositories": "Close Other Repositories",
|
||||||
"command.refresh": "Refresh",
|
"command.refresh": "Refresh",
|
||||||
"command.openChange": "Open Changes",
|
"command.openChange": "Open Changes",
|
||||||
"command.openAllChanges": "Open All Changes",
|
"command.openAllChanges": "Open All Changes",
|
||||||
|
|
|
@ -962,6 +962,16 @@ export class CommandCenter {
|
||||||
this.model.close(repository);
|
this.model.close(repository);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@command('git.closeOtherRepositories', { repository: true })
|
||||||
|
async closeOtherRepositories(repository: Repository): Promise<void> {
|
||||||
|
for (const r of this.model.repositories) {
|
||||||
|
if (r === repository) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
this.model.close(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@command('git.openFile')
|
@command('git.openFile')
|
||||||
async openFile(arg?: Resource | Uri, ...resourceStates: SourceControlResourceState[]): Promise<void> {
|
async openFile(arg?: Resource | Uri, ...resourceStates: SourceControlResourceState[]): Promise<void> {
|
||||||
const preserveFocus = arg instanceof Resource;
|
const preserveFocus = arg instanceof Resource;
|
||||||
|
|
Loading…
Reference in a new issue