This commit is contained in:
Logan Ramos 2021-07-12 14:48:27 -04:00
parent 2e6df245d2
commit c1ae18fad7
No known key found for this signature in database
GPG key ID: D9CCFF14F0B18183
2 changed files with 6 additions and 2 deletions

View file

@ -577,7 +577,7 @@
},
{
"command": "git.openChange",
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0"
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0 && resourcePath in git.changedResources"
},
{
"command": "git.stage",
@ -1324,7 +1324,7 @@
{
"command": "git.openChange",
"group": "navigation",
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0 && !isInDiffEditor && resourceScheme == file"
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0 && !isInDiffEditor && resourceScheme == file && resourcePath in git.changedResources"
},
{
"command": "git.stageSelectedRanges",

View file

@ -1847,6 +1847,7 @@ export class Repository implements Disposable {
this._submodules = submodules!;
this.rebaseCommit = rebaseCommit;
const untrackedChanges = scopedConfig.get<'mixed' | 'separate' | 'hidden'>('untrackedChanges');
const index: Resource[] = [];
const workingTree: Resource[] = [];
@ -1905,6 +1906,9 @@ export class Repository implements Disposable {
// set count badge
this.setCountBadge();
// Update context key with changed resources
commands.executeCommand('setContext', 'git.changedResources', workingTree.map(r => r.resourceUri.fsPath.toString()));
this._onDidChangeStatus.fire();
this._sourceControl.commitTemplate = await this.getInputTemplate();