mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-26 20:54:27 +00:00
fixes #67814
This commit is contained in:
@@ -362,6 +362,11 @@
|
||||
"title": "%command.ignore%",
|
||||
"category": "Git"
|
||||
},
|
||||
{
|
||||
"command": "git.revealInExplorer",
|
||||
"title": "%command.revealInExplorer%",
|
||||
"category": "Git"
|
||||
},
|
||||
{
|
||||
"command": "git.stashIncludeUntracked",
|
||||
"title": "%command.stashIncludeUntracked%",
|
||||
@@ -507,6 +512,10 @@
|
||||
"command": "git.restoreCommitTemplate",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "git.revealInExplorer",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "git.undoCommit",
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
@@ -913,6 +922,11 @@
|
||||
"when": "scmProvider == git && scmResourceGroup == merge",
|
||||
"group": "inline"
|
||||
},
|
||||
{
|
||||
"command": "git.revealInExplorer",
|
||||
"when": "scmProvider == git && scmResourceGroup == merge",
|
||||
"group": "2_view"
|
||||
},
|
||||
{
|
||||
"command": "git.openFile2",
|
||||
"when": "scmProvider == git && scmResourceGroup == merge && config.git.showInlineOpenFileAction && config.git.openDiffOnClick",
|
||||
@@ -948,6 +962,11 @@
|
||||
"when": "scmProvider == git && scmResourceGroup == index",
|
||||
"group": "inline"
|
||||
},
|
||||
{
|
||||
"command": "git.revealInExplorer",
|
||||
"when": "scmProvider == git && scmResourceGroup == index",
|
||||
"group": "2_view"
|
||||
},
|
||||
{
|
||||
"command": "git.openFile2",
|
||||
"when": "scmProvider == git && scmResourceGroup == index && config.git.showInlineOpenFileAction && config.git.openDiffOnClick",
|
||||
@@ -1007,6 +1026,11 @@
|
||||
"command": "git.ignore",
|
||||
"when": "scmProvider == git && scmResourceGroup == workingTree",
|
||||
"group": "1_modification@3"
|
||||
},
|
||||
{
|
||||
"command": "git.revealInExplorer",
|
||||
"when": "scmProvider == git && scmResourceGroup == workingTree",
|
||||
"group": "2_view"
|
||||
}
|
||||
],
|
||||
"editor/title": [
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
"command.publish": "Publish Branch",
|
||||
"command.showOutput": "Show Git Output",
|
||||
"command.ignore": "Add to .gitignore",
|
||||
"command.revealInExplorer": "Reveal in Explorer",
|
||||
"command.stashIncludeUntracked": "Stash (Include Untracked)",
|
||||
"command.stash": "Stash",
|
||||
"command.stashPop": "Pop Stash...",
|
||||
|
||||
@@ -2069,6 +2069,19 @@ export class CommandCenter {
|
||||
await this.runByRepository(resources, async (repository, resources) => repository.ignore(resources));
|
||||
}
|
||||
|
||||
@command('git.revealInExplorer')
|
||||
async revealInExplorer(resourceState: SourceControlResourceState): Promise<void> {
|
||||
if (!resourceState) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(resourceState.resourceUri instanceof Uri)) {
|
||||
return;
|
||||
}
|
||||
|
||||
await commands.executeCommand('revealInExplorer', resourceState.resourceUri);
|
||||
}
|
||||
|
||||
private async _stash(repository: Repository, includeUntracked = false): Promise<void> {
|
||||
const noUnstagedChanges = repository.workingTreeGroup.resourceStates.length === 0;
|
||||
const noStagedChanges = repository.indexGroup.resourceStates.length === 0;
|
||||
|
||||
Reference in New Issue
Block a user